git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [rebase] `fatal: cannot force update the branch ... checkout out at ...` is confusing when it isn't active
@ 2023-07-12  0:45 Josh Soref
  2023-07-12 15:04 ` Junio C Hamano
  0 siblings, 1 reply; 6+ messages in thread
From: Josh Soref @ 2023-07-12  0:45 UTC (permalink / raw)
  To: git

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.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-07-21 21:53 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-12  0:45 [rebase] `fatal: cannot force update the branch ... checkout out at ...` is confusing when it isn't active Josh Soref
2023-07-12 15:04 ` Junio C Hamano
2023-07-12 20:33   ` Josh Soref
2023-07-12 20:49     ` Junio C Hamano
2023-07-12 22:25       ` Re* " Junio C Hamano
2023-07-21 21:53         ` [PATCH v2] branch: update the message to refuse touching a branch in-use Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).