0
0

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 3 years have passed since last update.

【Github】メインブランチの最新情報を作業用ブランチに反映させる方法

Last updated at Posted at 2021-01-30

実行したいこと

ローカル環境内で作業中のブランチに、リモート環境内のメインブランチ(開発段階で主軸として積極的にマージを行っているブランチ: master/developなど)の最新状態を反映させる。

git merge origin/"メインブランチ名"で作業用ブランチに最新状態を反映

以下はメインブランチをdevelop, 作業用ブランチをfeature1として説明*

①作業中のブランチに移動

terminal
$ git checkout feature1

②作業途中の物をリモート環境にpushしておく(ない場合はそのまま③へ)

terminal
$ git add *
$ git commit -m "任意のコメント"
$ git push origin feature1

③メインブランチの内容を作業用ブランチに反映させる

terminal
$ git merge origin/develop

上記の手順によりリモート環境にあるメインブランチの最新情報を作業中のブランチに取り込むことができる。

記載内容に間違いがあった場合はご指摘頂けると嬉しいです。
ご連絡お待ちしております。

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?