LoginSignup
10
3

More than 3 years have passed since last update.

fatal: 'origin/hoge_branch' is not a commit and a branch 'hoge_branch' cannot be created from it

Posted at

特定のリモートブランチをcheckoutしたくてこれをやるとこのエラーになる。

git checkout -b hoge_branch origin/hoge_branch
fatal: 'origin/hoge_branch' is not a commit and a branch 'hoge_branch' cannot be created from it

# しばし悩んで、ローカルはリモートブランチ名を知らないことに気づく
git fetch

git branch -a
* master
  remotes/origin/hoge_branch

# これでチェックアウトできる
10
3
0

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
10
3