How to Fix GitHub Merge conflicts!

We are all monkeys before GitHub. That’s why it’s important to let the Programmer teach you how to do this first, before you mess with the Master branch!

  1. While on Master branch, Open the Repository in your Terminal. (GitHub desktop application, Repo-> open in Terminal).
  2. If there are any changes to your current branch, commit it.
  3. If there are any scenes that I do want to make sure to have a backup of, “save scene as” and save it under a different name, so that we can replace it later on.
  4. Type “git status”
  5. I received this status: “Last login: Mon Oct 1 10:54:29 on ttys001 Daniels-MBP-2:Project-Lunchbox DanielKim$ git status On branch master Your branch is up-to-date with ‘origin/master’. nothing to commit, working tree clean Daniels-MBP-2:Project-Lunchbox DanielKim$”
  6. Type “git merge”
  7. I received this message: “Daniels-MBP-2:Project-Lunchbox DanielKim$ git merge origin/PEET-loves-GIT-V2 warning: Cannot merge binary files: Project Lunchbox/Assets/ALL SCENES/Map_Level2.unity (HEAD vs. origin/PEET-loves-GIT-V2) Auto-merging Project Lunchbox/Assets/ALL SCENES/Map_Level2.unity CONFLICT (content): Merge conflict in Project Lunchbox/Assets/ALL SCENES/Map_Level2.unity Automatic merge failed; fix conflicts and then commit the result. Daniels-MBP-2:Project-Lunchbox DanielKim$”
  8. Type “git checkout –theirs “Project Lunchbox”/Assets/”ALL SCENES”/Map_Level2.unity” This is basically the point where you know their stuff is important and you want to merge it into the master – but thats okay because you still have your stuff in the saved as scene.
  9. Type “git commit -a”. A Giant text blog pops up, it looks like Vim or Vi program.
  10. Type “:q” and hit enter. This colon is important.
  11. type “git push”.
  12. At this point, the github website will say that the merge has been successfully completed.
  13. Check your new scenes in master. Fix any problems and port them over into your backup scene. Once you’re done, replace the old scene with the new one by saving the scene with the same name and forcing it to replace.
  14. You’re done!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s