Re: [rebase] `fatal: cannot force update the branch ... checkout out at ...` is confusing when it isn't active
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jul 12, 2023, 15:04 UTC
- Message-ID
- <xmqqbkghw4qd.fsf@gitster.g>
- In-Reply-To
- <CACZqfqAB7zyn56+NOL=E8Y3bXNiQnJdmVXgzsnj78C-Anw-h2Q@mail.gmail.com>
Josh Soref <jsoref@gmail.com> writes:
Show 17 quoted lines
> Consider this series of unfortunate commands: > ```sh > % (cd $(mktemp -d); git init; (touch a; git add a; git commit -m a; > touch b; git add b; git commit -m b; git bisect start; git branch next > HEAD~; git checkout next ) 2>/dev/null >/dev/null; git log --oneline > -1 HEAD; git branch -f main HEAD;) > Initialized empty Git repository in > /private/var/folders/r3/n29fz25x72x191fdv6mhhr3m0000gp/T/tmp.fGD64HAf/.git/ > accc238 (HEAD -> next) a > fatal: cannot force update the branch 'main' checked out at > '/private/var/folders/r3/n29fz25x72x191fdv6mhhr3m0000gp/T/tmp.fGD64HAf' > ``` > > It's true git in the repository does have a pin of sorts for the > `main` branch and that `git-rebase` would be very upset if the > branch's location were changed, but as an end user, the `main` branch > is not checked out, the `next` branch is checked out.
Fair enough. Perhaps "cannot force update the branch 'main' in use" would alleviate the confusion?