在另一个问题中,建议使用它来.gitattributes
跟踪文件但不合并到不同的分支中,但我下面的用例似乎不起作用..
mkdir git
cd git
git init
echo "B" > b.txt
git add b.txt
git commit -m 'Initial commit'
echo "b.txt merge=keepMine" > .gitattributes
git add .gitattributes
git config merge.keepMine.name "always keep mine during merge"
git config merge.keepMine.driver "keepMine.sh %O %A %B"
git commit -m 'Ignore b.txt'
git checkout -b test # Create a branch
git checkout master # Back to master and make change
echo "Only in master" > b.txt
git commit -a -m 'In master'
git checkout test
git merge master # The change in b.txt is being merged...
任何的想法?谢谢..