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

[PATCH] git-branch.txt: document -f correctly

From
Michael J Gruber <git@drmicha.warpmail.net>
Date
Mar 17, 2009, 14:06 UTC
Message-ID
<1237298780-11304-1-git-send-email-git@drmicha.warpmail.net>
In-Reply-To
<7vtz5ssk0s.fsf@gitster.siamese.dyndns.org>

'git branch -f a b' resets a to b when a exists, rather then deleting a. Say so in the documentation.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
---
Something like this?

BTW, I noticed that 'git-subcmd' is used everywhere in here which does not feel right, but I followed the existing style, leaving a consistent clean-up for a later patch. Also, typesetting is inconsistent: We have <branch> as well as `<branch>` when the text talks about the options. Do we have a style guide or such?

 Documentation/git-branch.txt |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/Documentation/git-branch.txt b/Documentation/git-branch.txt
index 6103d62..27b73bc 100644
--- a/Documentation/git-branch.txt
+++ b/Documentation/git-branch.txt
@@ -76,8 +76,8 @@ OPTIONS
 	based sha1 expressions such as "<branchname>@\{yesterday}".
 
 -f::
-	Force the creation of a new branch even if it means deleting
-	a branch that already exists with the same name.
+	Reset <branchname> to <startpoint> if <branchname> exists
+	already. Without `-f` 'git-branch' refuses to change an existing branch.
 
 -m::
 	Move/rename a branch and the corresponding reflog.
-- 
1.6.2.149.g6462
Previous: Junio C HamanoNext: Junio C Hamano
Message 12 of 15 in “undoing something”
  1. John DlugoszMar 16, 2009
  2. Junio C HamanoMar 16, 2009
  3. John DlugoszMar 16, 2009
  4. Junio C HamanoMar 16, 2009
  5. Effective PostingJohn Dlugosz, Mar 16, 2009
  6. René ScharfeMar 16, 2009
  7. John DlugoszMar 16, 2009
  8. Jay SoffianMar 16, 2009
  9. John DlugoszMar 16, 2009
  10. (unknown)Nanako Shiraishi, Mar 16, 2009
  11. Junio C HamanoMar 17, 2009
  12. git-branch.txt: document -f correctlyMichael J Gruber, Mar 17, 2009
  13. Junio C HamanoMar 17, 2009
  14. Michael J GruberMar 17, 2009
  15. John DlugoszMar 17, 2009

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.