LoginSignup
222
184

More than 3 years have passed since last update.

ローカルブランチに特定のリモートブランチをpull

Last updated at Posted at 2018-06-12

よく忘れるのでメモ。

やりたいこと

  • 特定のローカルブランチに特定のリモートブランチの差分をpullする

ローカルのブランチ一覧

$ git branch
* master
test

リモートのブランチ一覧

$ git branch -r
origin/HEAD -> origin/master
origin/add-whitespace-mode
origin/master

ローカルのリモートブランチを最新化

$ git fetch

特定のローカルブランチに特定のリモートブランチの差分をpullする

$ git pull origin REMOTE-BRANCH-NAME:LOCAL-BRANCH-NAME

例えば、リモートにあるadd-whitespace-modeというブランチをローカルのtestというブランチに持ってきたいときは以下。

$ git pull origin add-whitespace-mode:test

 関連

222
184
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
222
184