Skip to contentSkip to conversation

Document new "already-merged" rule for branch -d

PATCH New Jonathan Nieder 1 participant 1 message Jun 15, 2016 Documentation

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Document new "already-merged" rule for branch -d

v1.7.0-rc0~18^2 (branch -d: base the "already-merged" safety on the branch it merges with, 2009-12-29) taught ‘git branch’ a new heuristic for when it is safe to delete a branch without forcing the issue. It is safe to delete a branch "topic" without second thought if:

- the branch "topic" is set up to pull from a (remote-tracking, usually) branch and is fully merged in that "upstream" branch, or

- there is no branch.topic.merge configuration and branch "topic" is fully merged in the current HEAD.

Update the man page to acknowledge the new rules.

---
I was looking in the documentation for a way to disable the new behavior. But that was the wrong idea --- better to see what it’s like to get used to it first.

 Documentation/git-branch.txt |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
Documentation/git-branch.txt +3 -1
index d78f4c7..1940256 100644
@@ -63,7 +63,9 @@ way to clean up all obsolete remote-tracking branches.
 OPTIONS
 -------
 -d::
-	Delete a branch. The branch must be fully merged in HEAD.
+	Delete a branch. The branch must be fully merged in its
+	upstream branch, or in `HEAD` if no upstream was set with
+	`--track` or `--set-upstream`.
 
 -D::
 	Delete a branch irrespective of its merged status.
Signature · 1 line
1.7.1.rc1