新しい作業環境で開発リポジトリのmasterリポジトリをcloneしたあとにその他のブランチもcheckout/pullしたいときに以下のコマンドを実行する。
$ git branch -b new_branch_name origin/new_branch_name
以下のようなエラーが出る場合はリモートの確認
error fatal: 'origin/new_branch_name' is not a commit and a branch 'new_branch_name' cannot be created from it
リモートのブランチのリストを確認
$ git branch -r
branch 表示されない場合は更新する
$ git fetch --prune
これで、リモートからブランチを作成可能
コメント