threads / discuss / 41140

git pull --rebase overwrites/deletes empty commits

Subject: git pull --rebase overwrites/deletes empty commits

## tl;dr

One message between Jan 7, 2016 and Jan 7, 2016.

replies: 0people: 1as markdown or json

Bastian Binder· Jan 7, 2016, 12:56 UTC · lore
Hello,

I have recently encountered a probable bug in git. We have messages we want to appear in the log and do an empty commit:

git commit --allow-empty -m "message we want to publish"

After this commit, we do a fetch-rebase in order to pull the intermediate commits into the local branch before pushing:

git pull --rebase branch origin branch

Problem is: the pull --rebase will delete the empty commit. I see git rebase has a --keep-empty option. I cannot find such option for the pull --rebase operation.

Thanks in advance,
Bastian

← back to recent threads