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?

[Git] 複数のミラーレポジトリにpushするときConflictしたときの対処法

Posted at

複数のレポに同時にpushするときConflict

ごくまれに納品先と自社用で2つのレポジトリを併用するときがあり、
その際Conflictに悩まされたのでその覚書

この記事では2つのレポを手元でmergeしてcommit履歴を統合して解決する方法を紹介します。

# まずは.gitのあるフォルダ階層へ移動
cd project

# 手元に新しいbranchとしてコンフリクトしたレポジトリを追加
git remote add mirror git@github:CONFLICT/project.git

# 同期
git fetch mirror

# コンフリクトした内容を取り込むbranchに切り換え
git checkout develop

# 取り込み
git merge mirror/develop

# mirrorを削除
git remote remove mirror
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?