From 9ce108b525ecee795493d16ae7851062c5ee6a58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?benjamin=20melan=C3=A7on?= Date: Fri, 21 Apr 2023 18:32:29 -0400 Subject: [PATCH] Add more old per-project docs to our general git usage --- tools/git-usage.md | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) 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