0
0

More than 1 year has passed since last update.

【Git】ローカルにないリモートブランチを取り込む方法

Posted at

git fetch

まずリモート追跡ブランチが存在するか確認するためにgit branch -rを実行します。

git branch -r

この時点でリモート追跡ブランチが存在すればgit fetchは不要です。
存在しない場合はgit fetchで作成します。

git fetch

特定のブランチのリモート追跡ブランチのみ作成するには次のように実行します。

git fetch origin ブランチ名

git checkout

ローカルブランチ名を指定してリモートブランチをチェックアウトします。

git checkout ブランチ名 origin/ブランチ名
0
0
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
0
0