Over the course of a few years using git, I’ve come across several situations which required a bit of help from Google to get me through. Below you will find a number of common questions regarding git workflow and links to their globally accepted solutions (courtesy of StackOverflow). This is, of course, primarily for reference purposes. Bookmark and reference it for when you’re in a jam.
- How to I force git to overwrite local files on pull?
- How do I edit an incorrect commit message in git?
- How do I undo my last commit?
- How do I fix merge conflicts in git?
- How do I undo a git merge?
- How do I undo my last git pull?
- I accidently did
git addon a file or files I didn’t want. How do I undo
git addbefore I commit?
- I have a bunch of branches on github. How do I pull down and track all remote branches in git?
- How do I make an existing git branch track a remote branch?
- How do I view the change history of a file in git?
- How do I create a remote branch in git?
- How do I reset/revert a specific file to a previous revision using git?
- How do I move existing, uncommited work to a new branch in git?
- How do I stop git from tracking a file but not delete it from my system?
- How do I fix
.gitignoreso it ignores files already committed/tracked in my repository?