Here are some tricks that I use. They’re here because I need a place to quickly refer to them.
- Updating a fork with upstream changes:
- Reference: https://help.github.com/articles/syncing-a-fork/
- git fetch upstream
- git checkout master
- git merge upstream/master
- Interactive rebasing:
- git rebase -i <branch>
- To avoid messing up a PR, you can do things like:
- git reset –hard HEAD-1 # or HEAD-2, etc, or directly to a commit hash
- git push –force origin branch_name
- Always do a backup before reset or rebase