From: Andy Parkins <andyparkins@gmail.com>
To: git@vger.kernel.org
Subject: git branch -D won't delete the branch you're on
Date: Fri, 26 Jan 2007 12:00:47 +0000 [thread overview]
Message-ID: <200701261200.48813.andyparkins@gmail.com> (raw)
Hello,
Minor nitpick, that is not dreadfully important, but now that we have the
detached HEAD facility, is it reasonable to expect this to work?
$ git checkout -b somebranch HEAD^
$ git branch -d somebranch
error: Cannot delete the branch 'testcvs' which you are currently on.
Especially given that this will work (albeit with a warning):
$ git checkout HEAD^
warning: you are not on ANY branch anymore.
If you meant to create a new branch from the commit, you need -b to
associate a new branch with the wanted checkout. Example:
git checkout -b <new_branch_name> HEAD^
Andy
--
Dr Andy Parkins, M Eng (hons), MIEE
andyparkins@gmail.com
reply other threads:[~2007-01-26 12:01 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=200701261200.48813.andyparkins@gmail.com \
--to=andyparkins@gmail.com \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.