新しいリポジトリを作ったり既存のリポジトリを別のPCに持ってくるときに毎回苦労するのでメモを作ります。
github上に存在するリポジトリを別PCで編集する環境を作ります。
git clone [email protected]:ledsun/SandBox.git
実行したディレクトリにSandBoxというディレクトリができるます。SandBoxというディレクトリを先に作らない点に注意。
ガイド通りにhttpsスキーマ使うとユーザ名を聞かれてハマるのでurlを変えること
git remote add origin [email protected]:ledsun/SandBox.git
git branch -a
###ブランチを作成
git checkout -b work master
###リモートにpush
git push origin work
###ブランチを切り替え
git checkout master
git clone [email protected]:ledsun/SandBox.git
git fetch && git checkout branch_name