在另一个问题 ,建议使用.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...
任何的想法? 谢谢..