Re: rebase -i --update-refs can lead to deletion of branches
On Thu, Nov 3, 2022 at 4:34 PM herr.kaste <herr.kaste@gmail.com> wrote:
Show 13 quoted lines
>
> I have the following reproduction
>
> ```
> git init &&
> git commit --allow-empty -m "Init" &&
> git commit --allow-empty -m "A" &&
> git checkout -b feature &&
> git commit --allow-empty -m "B" &&
> git commit --allow-empty -m "C" &&
> GIT_SEQUENCE_EDITOR="sed -i -e '/^update-ref/d'" git rebase
> --update-refs master^ --interactive
> ```
Some minor changes
Better explicitly name the branch master
git init -b master &&
also
GIT_SEQUENCE_EDITOR="sed -i -e '/^u/d'" git rebase --update-refs
master^ --interactive
in case of short-form interactive rebase
But yes, it deletes the master branch