git - .gitattributes & individual merge strategy for a file -


I have a master and an exam branch of my (web) application

whenever I have a I merge the branch into another, so I would like to keep that branch up to the version of setup. That is, git should not try to merge the changes in that file.

I created the Pro Guit Book (http://progit.org/book/pt-br/ch7-2 HTML) and a .gitattributes file, however, with the "setup merge = our" line, it Does not work - Neither goes faster and merges, if I oppose.

(to be exact:

  $: mkdir gitest $: cd gittest $: git init $: "setup merge = our"> gt; gt; : Echo "master" & gt; Setup $: Add git setup .gitattributes $: git commit -a -m ... $: git branch trial $: git checkout exam $: reverberation "test" & gt; Setup $: git commit -a -m ... $: git checkout master $: git merge test   

Expected Result: In the setup, the word is "master", instead of GIT FF merges and "tests" the setup.)

S was the only error and it can be resolved to define "our" merge driver in .git / config:

  [merge "our"] name = "keep our merge" Driver = true   

Since true always returns 0, the temporary file will not be replaced with the current status and will remain in the form of the final version.

You can read more about this here to merge the driver:

Ad Dendum:

This is actually called a driver at any time and Looks like when the same files (merge attributes git) change. If there is a change in the same branch then the driver is not being called.

Comments