My friend and I are trying to work on an iPhone project, but have a problem with version conflict management using github.
Example: Both of us are working on a certain line of code with xCode 4.2 (and the github mac client)
int majorVersion = 0;
1) He changes the code to int majorVersion = 999;
commits changes; syncs - no problems, will end up in github
2) Simultaneously, I change the code to int majorVersion = 666;
then:
- I commit changes
- conflict - I choose my certain version by selecting line of code (
int majorVersion = 666;
) - in xCode, I delete the funny <<<<<< HEAD bits (so that only
int majorVersion = 666;
remains) - commit changes
- finally: I try to Publish branch but get the following error:
error: unable to push to unqualified destination: HEAD The destination refspec neither matches an existing ref on the remote nor begins with refs/, and we are unable to guess a prefix based on the source ref. error: failed to push some refs to 'https://github.com/XXX/XXX.git'
What are we doing wrong? Is the main problem that I have deleted the funny <<<<< and the HEAD declaration in xCode (see screenshot below)? How are we supposed to handle such conflicts?