An open API service indexing awesome lists of open source software.

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

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