marc:linux:git
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| marc:linux:git [2022/08/09 09:06] – [Forking] marcv | marc:linux:git [2022/08/09 09:46] (current) – [Rebasing vs Merging] marcv | ||
|---|---|---|---|
| Line 1098: | Line 1098: | ||
| ====== Git Rebase ====== | ====== Git Rebase ====== | ||
| + | |||
| + | Very useful as long as you know when NOT to use it! | ||
| + | |||
| + | Rebasing can be used: | ||
| + | - as an alternative to merging branches | ||
| + | - as a cleanup tool | ||
| + | |||
| + | |||
| + | ===== Rebasing vs Merging ===== | ||
| + | |||
| + | Imagine you are working on a feature branch while a lot of other people are working on other features. While you are working on your feature branch, the remote main branch gets keeping changed with changes made by other developers. You would want to merge these changes into your local feature branch. | ||
| + | |||
| + | {{: | ||
| + | |||
| + | Because of these merges, there are a lot commits which are not really functional but just merges. The same goes for the other developers. | ||
| + | |||
| + | Instead of merging the changes from remote main all the time, we can //rebase// which rewrites history: | ||
| + | |||
| + | {{: | ||
| + | |||
| + | |||
| + | ===== Git Rebase Basics ===== | ||
| + | |||
| + | ===== When NOT to Rebase ===== | ||
marc/linux/git.1660028801.txt.gz · Last modified: (external edit)
