在another question建議,以保持跟蹤,但在不同的分支不會合並,但低於我的使用情況下,似乎沒有工作的文件,以使用.gitattributes
..防止從主合併文件使用Git
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...
任何想法?謝謝..
這看起來像一個奇怪的願望合併一切只有一個文件。當所有內容都作爲一個整體來維護時,它違背了git意識形態。你能解釋一下用例嗎?你爲什麼需要它? –