diff --git a/tools/git-usage.md b/tools/git-usage.md index 428dd8e..45bf2aa 100644 --- a/tools/git-usage.md +++ b/tools/git-usage.md @@ -1,4 +1,24 @@ -# Git Usage +# Git usage + +## Getting in sync with other developers + +To bring in changes from other developers into the branch you are +working on, from main `git pull` and then `git checkout your-branch-name` and `git rebase main` + +## Git troubleshooting + +If you've accidentally made commits to main and cannot pull in other's changes as a result. + +To get rid of a commit (the most recent one), + +``` +git reset HEAD^ +``` + +to then be able to `git stash` changes from the commit, now local changes. To just throw everything in the commit away, `git reset --hard HEAD^` + +See https://sethrobertson.github.io/GitFixUm/fixup.html + ## When NOT to manually resolve merge conflicts