A Note About Conflicts
A Note About Conflicts κ΄λ ¨
Note that when performing a rebase, you may run into conflicts just as when merging. You may have conflicts because when rebasing, you are trying to apply patches on a different base, perhaps where the patches do not apply.
For example, consider the previous repository again, and specifically, consider the change introduced in "Commit 12", pointed to by main
:
git show main
I already covered the format of git diff
in detail in a previous post, but as a quick reminder, this commit instructs Git to add a line after the two lines of context:
And before these three lines of context:
def new_feature():
print('new feature')
Say you are trying to rebase "Commit 12" onto another commit. If, for some reason, these context lines don't exist as they do in the patch on the commit you are rebasing onto, then you will have a conflict. To learn more about conflicts and how to resolve them, see this guide.