Currently we commit binary files into source control and these will be changed by different people and then re-committed. However this can produce merge-conflicts.
Realistically as these files contain things like images it doesn’t make sense to merge them.
I’m wondering if there is a git command that allows a possible merge conflict between binary files.
IE: There is are two repositories and a bare remote repo which they use to share. There is a file image.png that the users the two repositories make seperate changes to and commit. They then pull the changes made and then push their changes to the remote repo. Obviously this generates a merge conflict for one of the users. But this doesn’t make sense for image files, is it possible that the newest commit can be the most recent and the older commit can just be added to the history of the branch?
I’m well aware this isn’t exactly how things are supposed to be done, but this is the situation I’m in so I’m wondering if anyone has a solution.
Yep.
git resetjust the conflicting paths to the versions you want to supersede (git resetthecommitwiththesupersededfiles--paths), commit that, then add (or reset to) the replacement (i.e. correct) versions and commit the result. If you don’t like having artificial and known-to-be-inconsistent commits on your mainline you could also make an orphan commit of only the superseded files (with a commit message saying what’s up with them) and add that as a merge parent of the commit with the selected versions on your main branch. Read up ongit mktreeandgit commit-treeto see how to do that, it’s actually pretty darn easy.