@@ -45,17 +45,22 @@ to happen.
4545
4646With a `-d` or `-D` option, `<branchname>` will be deleted. You may
4747specify more than one branch for deletion. If the branch currently
48- has a reflog then the reflog will also be deleted. Use -r together with -d
49- to delete remote-tracking branches.
48+ has a reflog then the reflog will also be deleted.
49+
50+ Use -r together with -d to delete remote-tracking branches. Note, that it
51+ only makes sense to delete remote-tracking branches if they no longer exist
52+ in remote repository or if gitlink:git-fetch[1] was configured not to fetch
53+ them again. See also 'prune' subcommand of gitlink:git-remote[1] for way to
54+ clean up all obsolete remote-tracking branches.
5055
5156
5257OPTIONS
5358-------
5459-d::
55- Delete a branch. The branch must be fully merged.
60+ Delete a branch. The branch must be fully merged in HEAD .
5661
5762-D::
58- Delete a branch irrespective of its index status.
63+ Delete a branch irrespective of its merged status.
5964
6065-l::
6166 Create the branch's reflog. This activates recording of
@@ -153,9 +158,11 @@ $ git branch -d -r origin/todo origin/html origin/man <1>
153158$ git branch -D test <2>
154159------------
155160+
156- <1> Delete remote-tracking branches "todo", "html", "man"
157- <2> Delete "test" branch even if the "master" branch does not have all
158- commits from test branch.
161+ <1> Delete remote-tracking branches "todo", "html", "man". Next 'fetch' or
162+ 'pull' will create them again unless you configure them not to. See
163+ gitlink:git-fetch[1].
164+ <2> Delete "test" branch even if the "master" branch (or whichever branch is
165+ currently checked out) does not have all commits from test branch.
159166
160167
161168Notes
0 commit comments