(Have posted this question in SO already: 

I want to a file that will not be merged ever between branches, e.g. 

What I found that by using "config.php merge=ours" in the .gitattributes 
does not work as expected, but `git merge master --strategy=ours` works, 
any reason?

Command history:

mkdir git
> cd git
> git init
> echo "B" > b.txt
> git add b.txt 
> git commit -m 'Initial commit'

> echo "b.txt merge=ours" > .gitattributes
> git add .gitattributes 
> 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...

Any idea, or it is a bug?


You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To view this discussion on the web visit 
To post to this group, send email to git-users@googlegroups.com.
To unsubscribe from this group, send email to 
For more options, visit this group at 

Reply via email to