1
2

More than 1 year has passed since last update.

【Git】 リモートブランチをローカル環境で取得する

Last updated at Posted at 2021-02-16

この書き方で取得可能

git checkout -b <ブランチ名> origin/<ブランチ名>

git checkout -b develop origin/develop
git checkout -b feature/hoge origin/feature/hoge

checkoutに失敗した場合の対応

> git checkout -b develop origin/develop
fatal: 'origin/ブランチ名' is not a commit and a branch 'ブランチ名' cannot be created from it`

> # ローカル環境にリモートの情報を取得
> git pull

# 再度チェックアウトする
> git checkout -b develop origin/develop
1
2
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
1
2