user1359331
user1359331

Reputation: 51

Problems with automatic merging of Visual Studio Projects (unresolved conflicts) in Git/GitHub

A friend and I just started using git in conjunction with GitHub to help us manage our C# w/XNA project we are working on in Visual Studio 2010. Everything works correctly when only one person is making changes to the file, and his work pushes and merges correctly with the central repository. However, when we have two different people working on the code and making changes at the same time, the last person to push always has to deal with a manual merge when trying to pull the first person's changes, as the automatic one fails. This happens even if the changes we made were unrelated (I.E. One person adds a completely random, unused class and the other adds a second random, unused variable a different, unused class). We have probably spent a combined 3 hours or so fooling with this issue to no avail. I know that there are programs one can use to help facilitate manual merges, but I wanted to make sure that it wasn't some setting causing this issue. Thanks!

EDIT: We are now using a .gitignore file in our repository(this one here), and it seems as though we've made some progress. Now when the second person pulls to merge before pushing his changes, it does seem to make the change on his local copy (meaning his project file registers the change I made previously), but he is still unable to merge fully as he gets the following error when he performs a git pull:

warning: Cannot merge binary files: collision/collision.suo (HEAD vs db023c2075...)

Auto-Merging collision/collision.suo CONFLICT (content): Merge conflict in collision/collision.suo Automatic merge failed. Fix conflicts then commit the result.

I have checked and the .suo extension is included in the ignore file, so I am at a loss as to what is causing this issue. Any further help would be greatly appreciated, and thanks to those who have posted already.

Upvotes: 3

Views: 4828

Answers (2)

user1359331
user1359331

Reputation: 51

Alright! We finally solved the issue. Apparently the problem was with the .gitignore file and how it was created. I had just made a file in notepad before, but I guess it wasn't being picked up. All I did was recreate it in the git bash using the following:

touch .gitignore

then adding it and committing. Thanks for all of the suggestions all, definitely got me going in the right direction.

Upvotes: 2

vguzmanp
vguzmanp

Reputation: 825

You probably are not ignoring binary and local configuration files. You have to create the .gitignore file and list in it what you don't want to add to the repo. You can find more information here

Upvotes: 1

Related Questions