I am doing a rebase and have come to a file with conflicts, but these conflicts are basically impossible to resolve. The best way to deal with the situation would be to tell git to ignore the changes and keep the original. I can then go back and re-edit the file to make the changes.
How can I do this?
If another user has rebased and force pushed to the branch that you're committing to, a git pull will then overwrite any commits you have based off that previous branch with the tip that was force pushed.
To save your changes and exit the document, type :wq! and press Enter key. It should appear at the end of the document like this. To exit the document without saving, type :q! and press Enter key.
rebase does not lose any history at all. Every single commit that you used to have is still there.
You can run git rebase --abort to completely undo the rebase. Git will return you to your branch's state as it was before git rebase was called. You can run git rebase --skip to completely skip the commit.
If you have encountered a merge conflict you can do this
git checkout --ours file
or the other way round
git checkout --theirs file
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With