Git Solutions

It is quite common to run into interesting/annoying/challenging problems when working with git, so here are some solutions that have worked for me. However, you might find your specific circumstances mean they don't work for you.....

Changing Commit Author

I recently had an issue where a number of my commits were done with the wrong author details, so I used Changing author info - GitHub Help to fix the issue, which worked well.

Resolving Merge Conflicts

If you do a git merge and get a message saying something like "Automatic merge failed; fix conflicts and then commit the result" then you will need to do something like the following:

  • git status - this will report the list of un-merged files
  • fix the files, this means you need to deal with all the lines between the less than signs and gretaer than signs
  • git add <filename> - you'll need to do this for all the files
  • git commit - although you might want to add a message to this but a default will be prompted
You can see an example of this at 30. Resolving Conflicts.