https://github.com/rpearce/git-rebase-example
Drop the bass with git rebase
https://github.com/rpearce/git-rebase-example
Last synced: 2 months ago
JSON representation
Drop the bass with git rebase
- Host: GitHub
- URL: https://github.com/rpearce/git-rebase-example
- Owner: rpearce
- License: unlicense
- Archived: true
- Created: 2024-08-14T23:42:04.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-02-03T15:35:31.000Z (11 months ago)
- Last Synced: 2025-09-29T03:29:30.102Z (3 months ago)
- Language: Shell
- Size: 590 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# git-rebase-example
Dropping the bass with git rebase.
Art from The Git Rebase Introduction I Wish I Had
## The plan
Dive right in!
1. Merging `main` into our feature branch vs rebasing `main`
* What about conflicts?!?
1. Simple amending of commits with `git commit --amend`
1. Fixup, squash, reword, and delete our garbage commits with `git rebase -i`
* Reminder: drop the bass
1. A word about `git push`'s `--force` vs `--force-with-lease`
1. Survival tip: assume everyone is a secret rebaser & force pusher
* `git pull --rebase origin the-branch`
* `git config --global pull.rebase true`, or in `.gitconfig`:
```
[pull]
rebase = true
```
1. Rebase fearlessly with `git reflog`
1. Branching off branches, keeping up with rebasing, parent branch gets merged
to `main`, and what now? `git rebase --onto` ftw
1. Rebasing Etiquette, or: How to Not Make People Hate You
## Links
* https://git-scm.com/docs/git-rebase
* https://git-scm.com/book/en/v2/Git-Branching-Rebasing
* https://docs.github.com/en/get-started/using-git/about-git-rebase
* https://jvns.ca/blog/2023/11/06/rebasing-what-can-go-wrong-/
* https://git-scm.com/docs/git-reflog
* https://git-scm.com/docs/git-push
* https://git-scm.com/docs/git-pull
* https://git-scm.com/docs/git-commit