https://github.com/jeremylikness/git-fork-branch-cheatsheet
My cheat sheet for the git/fork/branch workflow
https://github.com/jeremylikness/git-fork-branch-cheatsheet
branch-cheatsheet branching git git-workflow
Last synced: 4 months ago
JSON representation
My cheat sheet for the git/fork/branch workflow
- Host: GitHub
- URL: https://github.com/jeremylikness/git-fork-branch-cheatsheet
- Owner: JeremyLikness
- Created: 2019-09-04T15:52:32.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2019-09-27T21:44:39.000Z (over 5 years ago)
- Last Synced: 2025-01-14T03:13:52.802Z (5 months ago)
- Topics: branch-cheatsheet, branching, git, git-workflow
- Size: 7.81 KB
- Stars: 8
- Watchers: 3
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# git-fork-branch-cheatsheet
My cheat sheet 📜 for the git/fork/branch workflow.
## âš™ Set up
1. Fork it
2. `git clone `
3. `git remote add upstream .git`## 🔃 Workflow
1. `git pull upstream master`
2. `git push origin master`
3. `git checkout -b `
4. Work. Work. Work.
5. `git push origin `
6. Create PR
7. Wait for it to be merged, then ...
8. `git checkout master`
9. `git pull upstream master`
10. `git branch -d ` (or `-D` if necessary)
11. `git push origin master`
12. `git push --delete origin `
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_