My cheat sheet 📜 for the git/fork/branch workflow.
- Fork it
git clone <forked repo>git remote add upstream <original repo>.git
git pull upstream mastergit push origin mastergit checkout -b <branch>- Work. Work. Work.
git push origin <branch>- Create PR
- Wait for it to be merged, then ...
git checkout mastergit pull upstream mastergit branch -d <branch>(or-Dif necessary)git push origin mastergit push --delete origin <branch>git pull upstream mastergit push origin master
(when things go wrong, force fork to sync with upstream)
âš WARNING only do this if you do not have pending commits. They will be obliterated!
git fetch upstreamgit reset --hard upstream/mastergit push origin master --force
quod erat demonstrandum