1

I have a project set up with Ionic Framework, and started working off of the master branch, setting up my own branch to do so on a branch called updates. There's also another branch called rc1-2015 that I'm trying to merge into the updates branch, but a lot of the bower components (and platforms directory) got updated in my updates branch, causing merge conflicts in nearly every file.

I want to keep all the bower components from the updates branch as they are now, but merge all the rest of the files. I've tried adding bower_components/* merge=ours to .gitattributes but it doesn't seem to do anything, there are still tons of merge conflicts.

How can I make it ignore the bower_components dir (and the platforms dir), but merge the rest of the files?

Jared
  • 2,006
  • 4
  • 23
  • 43

1 Answers1

1

As mentioned in "Whats the Proper usage of .gitattributes with merge=ours", don' t forget to activate the merge strategy:

git config --global merge.ours.driver true
Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • I was forgetting this, but it's still not solving my problem. Do I need to commit the `.gitattributes` file first or something? My `.gitattributes` file only contains one line: `bower_components/* merge=ours`. I've tried with two asterisks, and just `bower_components/`. – Jared Nov 10 '15 at 05:33
  • @Jared yes, the .gitattributes needs to be committed. – VonC Nov 10 '15 at 05:33
  • I did that, but still getting merge conflicts in the bower_components dir. I'm not sure what I'm doing wrong but I'm ready to start pulling my hair out... – Jared Nov 10 '15 at 05:35
  • @Jared see a full example at http://stackoverflow.com/a/930495/6309, with a committed .gitattributes. – VonC Nov 10 '15 at 05:35