LoginSignup
0
1

More than 3 years have passed since last update.

現在作業しているCurrentBranchにMasterBranchの情報を反映させたい時

Posted at

背景

プログラミングスクールにてフリマアプリをチーム開発している時でした。

現在作業しているブランチにマスターブランチの情報を持ってきたい・・・・

こんな時の解決法を今回紹介します。

以下の4つのコマンドをターミナルで入力するだけで大丈夫です!!

※注意点

コマンドを実行する前の注意点として、編集途中のファイル等がある場合は、一度コミット&プッシュして何もない状態にしておきましょう。


<!-- 開発中ブランチからmasterブランチへ移動 -->
$ git checkout master

<!-- リモートのmasterを反映 -->
$ git pull origin master

<!-- masterブランチから開発中のブランチへ移動 -->
$ git checkout 開発中のブランチ名

<!-- maserの内容を開発中ブランチに取り込む -->
$ git merge origin master

これで作業ブランチにマスターブランチの情報が反映されていると思います!!

最後まで記事を読んで頂きましてありがとうございます!!

参考になれば幸いです:pray_tone2:

0
1
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
1