Skip to content

Instantly share code, notes, and snippets.

@donchan922 donchan922/git.sh
Created Jul 31, 2019

Embed
What would you like to do?
# リモートブランチの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
You can’t perform that action at this time.