Zapobiegaj łączeniu pliku z mastera z Git

Winne pytanie zaleca się używanie.gitattributes aby plik był śledzony, ale nie został scalony w innej gałęzi, ale poniższy przypadek użycia wydaje się nie działać ..

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...

Dowolny pomysł? Dzięki..

questionAnswers(2)

yourAnswerToTheQuestion