3

Consider the following structure:

  • FolderA/SomeFile.abc
  • FolderA/SomeFile2.abc
  • FolderB/AnotherFile.abc
  • FolderB/AnotherFile2.abc

I would like to configure git so that when I do a git pull any possible conflicts in FolderA are auto-resolved with theirs. FolderB would behave normally.

I have seen several similar issues on stack overflow and have tried their solution to no avail. Most suggest a custom merge strategy, which doesn't seem to apply when I do a git pull?

Ideally the user issuing a git pull doesn't even know that their local changes to FolderA were discarded.

Bonus points if I can check this solution in so that everyone else on my team has the same behavior.

Thanks!

Edited to add more detailed scenario: I have a cloud build that I do not have control over (Unity Cloud Build). It kicks off when a new commit appears on a particular branch. My application has dependencies on class libraries that need to be built and added to a particular folder in order to be referenced. Unity Cloud Build cannot do this task, as it cannot build class libraries. This is causing me to have to check in these binaries.

Additionally, in order for a developer to iterate on these class libraries, we do the copying as a post build step locally. Eventually the developer will attempt a pull with local changes to these libraries and this causes a conflict. Ultimately I'm trying to prevent the developer from having this happen to them.

  • Maybe explain the root problem you are trying to solve. Probably there is a better way to solve that than trying to make some folders always resolve conflicts in a certain way. – tkruse Dec 27 '17 at 07:49
  • Edited to add more detailed scenario. – treywheeler Dec 28 '17 at 04:22
  • I would avoid committing your binaries into source control. The post build step you are doing locally sounds reasonable. I would try to do the same in Unity Cloud Build. Do they have the concept of custom build steps? – Bryan Bedard Dec 28 '17 at 04:56
  • you could instead [be rebuiding](https://stackoverflow.com/a/35442565/2303202) your binaries during conflict resolution. This would produce correct result of merges. – max630 Dec 28 '17 at 09:32
  • Have you tried `git checkout --theirs ./FolderA && git add ./FolderA && git commit` ? – Kashif Siddiqui Aug 23 '18 at 14:17

0 Answers0