aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/git-branch.txt
diff options
context:
space:
mode:
authorAndy Parkins <andyparkins@gmail.com>2006-11-21 19:31:24 +0000
committerJunio C Hamano <junkio@cox.net>2006-11-21 21:26:12 -0800
commitbfcc921430423828233dadfe274802ae68900f6e (patch)
tree65167c030fc80747a6a942c218f9d79209ad75b0 /Documentation/git-branch.txt
parent594270635732d6320d6e6d7fa127679ae90ef5b1 (diff)
downloadgit-bfcc921430423828233dadfe274802ae68900f6e.tar.gz
Add support to git-branch to show local and remote branches
Instead of storing a list of refnames in append_ref, a list of structures is created. Each of these stores the refname and a symbolic constant representing its type. The creation of the list is filtered based on a command line switch; no switch means "local branches only", "-r" means "remote branches only" (as they always did); but now "-a" means "local branches or remote branches". As a side effect, the list is now not global, but allocated in print_ref_list() where it used. Also a memory leak is plugged, the memory allocated during the list creation was never freed. It lays a groundwork to also display tags, but the command being 'git branch' it is not currently used. Signed-off-by: Andy Parkins <andyparkins@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'Documentation/git-branch.txt')
-rw-r--r--Documentation/git-branch.txt11
1 files changed, 8 insertions, 3 deletions
diff --git a/Documentation/git-branch.txt b/Documentation/git-branch.txt
index d43ef1dec4..5376760813 100644
--- a/Documentation/git-branch.txt
+++ b/Documentation/git-branch.txt
@@ -8,14 +8,16 @@ git-branch - List, create, or delete branches.
SYNOPSIS
--------
[verse]
-'git-branch' [-r]
+'git-branch' [-r] [-a]
'git-branch' [-l] [-f] <branchname> [<start-point>]
'git-branch' (-d | -D) <branchname>...
DESCRIPTION
-----------
-With no arguments given (or just `-r`) a list of available branches
+With no arguments given a list of existing branches
will be shown, the current branch will be highlighted with an asterisk.
+Option `-r` causes the remote-tracking branches to be listed,
+and option `-a` shows both.
In its second form, a new branch named <branchname> will be created.
It will start out with a head equal to the one given as <start-point>.
@@ -45,7 +47,10 @@ OPTIONS
a branch that already exists with the same name.
-r::
- List only the "remote" branches.
+ List the remote-tracking branches.
+
+-a::
+ List both remote-tracking branches and local branches.
<branchname>::
The name of the branch to create or delete.