次のディレクトリ構造があります。
/.git
/.git/info/attributes
/MyProject
/MyProject/pom.xml
/MyProject/MyCode.java
ブランチ マスターとバグ修正があります。両方のブランチで、pom.xml と MyCode.java が変更されました。バグ修正からマスターへの変更を MyCode.java のみにマージし、マスター バージョンの pom.xml ファイルを保持したいと考えています。
プロジェクトで.gitattributesをコミットしたくないので、「/.git/info/attributes」を追加しました
$cat .git/info/attributes
pom.xml merge=ours
$git status
# On branch master
nothing to commit (working directory clean)
$git check-attr -a pom.xml
pom.xml: merge: ours
最後に問題に:
私がする時:
$git merge bugfix
Auto-merging MyProject/pom.xml
CONFLICT (content): Merge conflict in MyProject/pom.xml
Automatic merge failed; fix conflicts and then commit the result.
Git は属性設定を無視しています。ここで何が欠けていますか?
この投稿ごとに「keepMine.sh」を定義したくない
この投稿は私が必要としているものですが、単純なパターンがある場合は、ファイルごとに移動するのは好きではありません
ありがとう!