public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox•com>
To: Josh Soref <jsoref@gmail•com>
Cc: git@vger•kernel.org
Subject: Re: [rebase] `fatal: cannot force update the branch ... checkout out at ...` is confusing when it isn't active
Date: Wed, 12 Jul 2023 08:04:42 -0700	[thread overview]
Message-ID: <xmqqbkghw4qd.fsf@gitster.g> (raw)
In-Reply-To: <CACZqfqAB7zyn56+NOL=E8Y3bXNiQnJdmVXgzsnj78C-Anw-h2Q@mail.gmail.com> (Josh Soref's message of "Tue, 11 Jul 2023 20:45:54 -0400")

Josh Soref <jsoref@gmail•com> writes:

> 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?


  reply	other threads:[~2023-07-12 15:04 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqbkghw4qd.fsf@gitster.g \
    --to=gitster@pobox$(echo .)com \
    --cc=git@vger$(echo .)kernel.org \
    --cc=jsoref@gmail$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox