LoginSignup
57
50

More than 5 years have passed since last update.

新しくリモートブランチをローカルに持ってこようとしたらエラーになる場合の対処

Last updated at Posted at 2014-01-16

下記コマンドでリモートブランチをローカルに・・・と思ったら、エラーが。

$ git checkout -b [newbranch] [origin/newbranch]
fatal: Cannot update paths and switch to branch ‘[newbranch]’ at the same time.
Did you intend to checkout '[newbranch]' which can not be resolved as commit?

一旦、リモートブランチのリストを確認。

$ git branch -r

あ、つくろうとしていたブランチがない。

リストを更新するコマンドを調べて実行。

$ git fetch --prune

もう一度最初のコマンドを実行するとできた。


Blog URL : http://www.utano.jp/ (Syntax Error.)

57
50
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
57
50