Search code examples
gitgit-rebasegit-commit

"(NO BRANCH, REBASING BRANCH_NAME)" prefixing each commit message after git rebase


I'm trying to edit a few previous commit messages. I started by doing a

git rebase -i %%commit-hash%%

Then, I set to 'reword' all the commits I wanted to edit, and subsequently edited the commit messages in the interactive process produced by git.

However, to my surprise, now each commit message is prefixed by: "(NO BRANCH, REBASING BRANCH_NAME)".

Why is this happening? And more importantly, how do I prevent git from inserting the prefix into my commit messages?


Solution

  • It was my bad: I had previously setup some hooks so that my commit messages be automatically prefixed with a bug Id.

    It seems that the hooks are triggered when doing a rebase as well, and thus messing up the produced message.

    Beware brothers :)