1
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

作業中のブランチに、masterの最新状態を加える

Posted at

はじめに

ブランチを切ったときのmasterについて、他の作業者が他ブランチで作業更新→masterにマージした場合、自分の作業用ブランチに最新状態を反映させたいときがあります。
その際の一連のコマンドを記します。

コマンド

最新のmasterブランチの更新状況を組み込みたいブランチに変更します。
例:hogehogeブランチで作業している場合

git checkout hogehoge

ブランチ変更後、下記コマンドを入力

git pull origin master

現在のhogehogeブランチにmasterの最新コードが反映されます。
この際、コンフリクトすることがよくあるので下記コマンド内容のUnmerged paths:に書かれたファイルを確認して、解消していきます。
解消後はgit commit -am "fix conflict"といった感じで、commitをします。

git status

Unmerged paths:
  (use "git add <file>..." to mark resolution)

	both modified:   App.js
1
3
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
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?