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.

【Git】マージ

Posted at

【Git】マージ

【基本のマージ ~ プルリクエスト】

環境 : visual studio 2019 professional

① 「ローカルブランチのfeature(ワーキングツリー)」を「git commit」する。
    「git push」は、まだしない事。

② 「origin/master」ブランチを、「git fetch + git merge」or 「git pull」する。
    (最新化する)

③ 「origin/master」ブランチ(元)を、「ローカルブランチのfeature」へマージする。

④  「競合を解決する」
   「ファイル比較」:差分を確認する。
   「左右どちらか」 or 「左右両方」を、選択する。
   「マージボタン押下」
    ※上手くいかない時は、「WinMerge」など使うこと。

⑤  VS再起動

⑥ 「ビルドされること(動作確認)」を確認したら、「git push」する。

⑦ 【プルリクエスト】
  「プルリクエスト先」のブランチを確認すること。
  • (※) VSでは、「プロジェクトのファイル」(.csproj)
    (プロジェクトの直下あたりに配置されている。)
    は、手動でマージします。
  • 「プロジェクトのファイル」(.csproj)で、エラーがあっても、
    「ビルドエラー」は出ません。。

【ローカルブランチに、リモートブランチを取り込む】

① 「ローカルブランチのfeature(ワーキングツリー)」を、「git stash」 or 「git commit」 or 「git push」する。

② 「origin/master」ブランチを、「git fetch + git merge」or 「git pull」する。
    (最新化する)

③ 「origin/master」ブランチ(元)を、「ローカルブランチのfeature」へマージする。

④  スタッシュがあれば、「ローカルブランチのfeature」へ、スタッシュを戻す。
   (※ 「現在のブランチ」を、必ず確認すること!!)
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?