Hi all,
I've already did an extensive search, read a lot of SO questions and solutions and tried it different ways, but I've been unable to do what I want, which is fairly simple.
I have the master branch, where all the main code resides, and the design branch, where the layout of the rails application is built by the design team. They have added a folder called "photoshop" to the public folder to keep their sources for the images also under version control. But I don't want this folder to be copied on merge to the master branch because, well, it is not needed.
Apparently, the way to do this is through a merge driver. So, I've created the "ignore" driver:
[merge "ignore"]
name = always ignore during merge
driver = ignore.sh %0 %A %B
And created the ignore.sh file on my $PATH:
exit 0
I've created the .gitattributes file inside public/, because the photoshop folder should be ignored in whole and it is going to appear under public/:
photoshop merge=ignore
photoshop/ merge=ignore
photoshop/* merge=ignore
photoshop/**/* merge=ignore
As you can see, I've tried several different patterns to ignoring the whole folder, but it does not work. I believe this is because there is no folder on the master branch, so there's no conflict and so git doesn't use the ignore driver. Is there a way to achieve this without having to create a public/photoshop folder on master?
Thanks!