项目作者: JeremyLikness

项目描述 :
My cheat sheet for the git/fork/branch workflow
高级语言:
项目地址: git://github.com/JeremyLikness/git-fork-branch-cheatsheet.git


git-fork-branch-cheatsheet

My cheat sheet 📜 for the git/fork/branch workflow.

⚙ Set up

  1. Fork it
  2. git clone <forked repo>
  3. git remote add upstream <original repo>.git

🔃 Workflow

  1. git pull upstream master
  2. git push origin master
  3. git checkout -b <branch>
  4. Work. Work. Work.
  5. git push origin <branch>
  6. Create PR
  7. Wait for it to be merged, then …
  8. git checkout master
  9. git pull upstream master
  10. git branch -d <branch> (or -D if necessary)
  11. git push origin master
  12. git push --delete origin <branch>
  13. git pull upstream master
  14. git push origin master

🆘 Get out of Jail, Free

(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!

  1. git fetch upstream
  2. git reset --hard upstream/master
  3. git push origin master --force

quod erat demonstrandum