git rebase
when you do a git rebase, git + you are taking these steps:
-
git rolls back to the original “base” (your branch and you want to rebase from).
-
git starts applying the new changes, commit-by-commit.
-
everytime there is a merge conflict. git stops and tells you to:
- solve the merge conflicts per file (read below first)
git add <FILENAME>orgit add .if you’re lazygit rebase --continue
you at this point (3.) should be aware that you are walking through history, and that means your changes may seem like they never happened (but they did, just in the future commit).
so your merge conflict resolutions, if you need to do them, should be done KNOWING that the future commit will be applied on TOP of your current code (because you are currently in between the history of the file).
- once it completes, you get kicked back out into your terminal. Hooray! you have just completed a hairy
git rebase.
- to move forward after a merge conflict,
git rebase --continue - to abort,
git rebase --abort - to skip commits,
git rebase --skip_but be sure, because it means you are not applying the said code change to the history of the file (so you have to do it afterward, or lose the changes)