Git rebase a branch onto master failed, how to resolve?

git rebase has found a .git/rebase-apply directory and so presumes that you might be in the middle of a rebase. This would have happened if there was a conflict during a previous rebase and the rebase was not finished; i.e. you did not run one of git rebase --abort, git rebase --skip or git rebase --continue (the last one after resolving the conflict).

Anyway, it does not matter how you ended up in this state if you don't think you ran git rebase at all. Simply rm -fr /my_project_directory/.git/rebase-apply as the help suggests and you should be able to do the rebase now.

But wait. Since you say that you have already published your branch to the remote repository, you should not try to rebase master onto it. In fact, if your remote is set to deny non-fast-forward commits (which seems to be a generally recommended best practice), you'll not even be able to push the rebase'd changes to your remote. In general, it is a bad practice to try to modify a commit (which is what git rebase does) after you have published it to a remote.


Go to your project directory. Find rebase-apply folder under .git and delete the folder.

Note : By default .git folder will be hidden.

Tags:

Git

Git Rebase