2

git で pull を実行し、手動で競合を解決する必要がある場合は、リベースを実行すると、同じ競合を再度解決する必要があります。競合を一度だけ解決する必要があるプロセスを見つけたいです。これは、現在私のために発生しているプロセスのより詳細な説明です。

1)ローカルの変更と競合があることを示す git pull を実行します。
2) 'git mergetool' を実行し、すべての競合を手動で解決します
。3) マージ解決の変更の 'git add' と 'git commit' を実行します。
4) 「git rebase origin/master」を実行して、ローカル コミットを一番上に配置します。
5)問題は次のとおりです。手順 2 と同じ競合をもう一度解決するように求められます。
6) 「git rebase --continue」を実行します

このプロセスからステップ 2) またはステップ 5) のいずれかを削除したいと思います。

4

2 に答える 2

4

git rerereを試す必要があります

git config --global rerere.enabled true

rerere を有効にすると、Git は実行した競合解決を記憶し、次回から自動的に適用します。

于 2013-05-15T18:14:25.437 に答える
1

You could do the pull using rebase instead of merge

git pull --rebase

This will first fetch the changes to your remote branch, then it will immediately try to rebase your local commits on top of the tip of the remote branch.

That way you should only have to do one conflict resolution step.

You can configure rebase to be the default pull behavior for a branch (in this case "master"):

git config branch.master.rebase true

You can also set rebase to be the default pull behavior for all new branches in all repositories:

git config --global branch.autosetuprebase always
于 2013-05-15T18:20:01.243 に答える