Skip to content

Instantly share code, notes, and snippets.

@donchan922
Created July 31, 2019 12:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save donchan922/b3f73592d6c422925e306d13e8109c78 to your computer and use it in GitHub Desktop.
Save donchan922/b3f73592d6c422925e306d13e8109c78 to your computer and use it in GitHub Desktop.
# リモートブランチのdevelopをローカルにチェックアウトできない
$ git checkout -b develop origin/develop
fatal: 'origin/develop' is not a commit and a branch 'develop' cannot be created from it
# リモートブランチの一覧を確認する(developがない)
$ git branch -r
origin/HEAD -> origin/master
origin/master
# リモートブランチから最新情報を取得する
$ git fetch --prune
From https://github.com/donchan922/sample
* [new branch] develop -> origin/develop
# 再度、リモートブランチの一覧を確認する(developがある)
$ git branch -r
origin/HEAD -> origin/master
origin/develop
origin/master
# 再度、リモートブランチのdevelopをローカルにチェックアウトする
$ git checkout -b develop origin/develop
M README.md
Branch 'develop' set up to track remote branch 'develop' from 'origin'.
Switched to a new branch 'develop'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment