git/list[1] front-page[2] threads[3] people[4] search[5] about
 

bug report: I was allowed to "git checkout -b" while mid-rebase

From
GBGrant Birchmeier <gbirchmeier@connamara.com>
Date
Jun 19, 2025, 00:12 UTC
Message-ID
<CAMq4opPBGT0Rv25DnEMHPjA=W_Ut2BDsN0KmxD2_xGTJa9erJQ@mail.gmail.com>

Hello. I've attached my git-bugreport, but I'll copy/paste the salient parts here. Thanks. Let me know if I can provide anything else.

*What did you do before the bug happened? (Steps to reproduce your issue)*

I was rebasing a branch "ilogger" on my master branch. While this rebase was still open, I accidentally ran `git checkout -b net5` (I meant to run it in a different console)... and it proceeded to switch me to the new branch even though the the rebase was still in progress.

*What did you expect to happen? (Expected behavior)*

I would expect an error message and a refusal to execute the `git checkout -b` command.

*What happened instead? (Actual behavior)*

It created a new branch "net5" off of my "ilogger" mid-rebase branch, and changed me to branch "net5". I cannot change back to "ilogger" ("error: you need to resolve your current index first"), and it appears I will need to finish my rebase on "net5". Even after I do that, I'm not sure what state "ilogger" will be in.

*What's different between what you expected and what actually happened?*

I think the proper bahavior is for the "git checkout -b" command to fail when the current branch is mid-rebase, just like it does when you run `git checkout` without the `-b`.

-- 
<https://www.connamara.com>

Grant Birchmeier

Director of Engineering, Connamara

gbirchmeier@connamara.com

-- 
This email, along with any attachments, is confidential. If you believe you 
received this message in error, please contact the sender immediately and 
delete all copies of the message. Thank you from Connamara Systems, LLC.


Thank you for filling out a Git bug report!
Please answer the following questions to help us understand your issue.

What did you do before the bug happened? (Steps to reproduce your issue)

I was rebasing a branch "ilogger" on my master branch.  While this rebase was still open, I accidentally ran `git checkout -b net5` (I meant to run it in a different console)... and it proceeded to switch me to the new branch even though the the rebase was still in progress.

What did you expect to happen? (Expected behavior)

I would expect an error message and a refusal to execute the `git checkout -b` command.

What happened instead? (Actual behavior)

It created a new branch "net5" off of my "ilogger" mid-rebase branch, and changed me to branch "net5".  I cannot change back to "ilogger" ("error: you need to resolve your current index first"), and it appears I will need to finish my rebase on "net5".  Even after I do that, I'm not sure what state "ilogger" will be in.

What's different between what you expected and what actually happened?

I think the proper bahavior is for the "git checkout -b" command to fail when the current branch is mid-rebase, just like it does when you run `git checkout` without the `-b`.

Anything else you want to add:

(nothing)

Please review the rest of the bug report below.
You can delete any lines you don't wish to share.


[System Info]
git version:
git version 2.45.0
cpu: x86_64
no commit associated with this build
sizeof-long: 8
sizeof-size_t: 8
shell-path: /bin/sh
feature: fsmonitor--daemon
uname: Darwin 24.5.0 Darwin Kernel Version 24.5.0: Tue Apr 22 19:53:26 PDT 2025; root:xnu-11417.121.6~2/RELEASE_X86_64 x86_64
compiler info: clang: 15.0.0 (clang-1500.3.9.4)
libc info: no libc information available
$SHELL (typically, interactive shell): /bin/bash


[Enabled Hooks]
Next: Jacob Keller
Message 1 of 5 in “bug report: I was allowed to "git checkout -b" while mid-rebase”
  1. Grant BirchmeierJun 19, 2025
  2. Jacob KellerJun 19, 2025
  3. Junio C HamanoJun 19, 2025
  4. Grant BirchmeierJun 19, 2025
  5. Re bug report: I was allowed to "git checkout -b" while mid-rebaseK Jayatheerth, Jun 19, 2025

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.