Reputation: 323
I'm a newbie at git and want to understand how to collaborate with a few friends on a project using git. My problem is trying to understand how to "updated to HEAD (like in SVN)" in git. I understand git's a bit different, and I would appreciate any help.
So consider this situation. There is Person A and Person B. Person A changes a file by making 1 addition. He then performs:
So, so far, this works, as on GitHub the repository has been updated with Person A's changes.
Now, assume that Person B during this whole time has been making changes of his own as well. He too, makes 1 addition. What should Person B do "update to HEAD" so that he can commit his changes as well. What Person B has tried is...
On the fourth line, he always gets a complaint of a conflict. Why?!
Any help would be greatly appreciated.
Upvotes: 0
Views: 737
Reputation: 90541
If git is complaining about a conflict, it means that person A and person B (could his name be Ian? ;) have modified the same file and the changes, well, conflict. Either the file is a binary file, for which git can never resolve two different modifications, or it's a text file and the two modifications touch the same set of lines.
You will have to resolve the conflict. You can use git mergetool
to help with this.
(Conflicts are not unique to git. They can happen with Subversion, too, for the same sort of reason.)
Upvotes: 1