Skip to content
Navigation Menu
Toggle navigation
Sign in
In this repository
All GitHub Enterprise
↵
Jump to
↵
No suggested jump to results
In this repository
All GitHub Enterprise
↵
Jump to
↵
In this organization
All GitHub Enterprise
↵
Jump to
↵
In this repository
All GitHub Enterprise
↵
Jump to
↵
Sign in
Reseting focus
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
Dismiss alert
{{ message }}
git-mirror
/
git
Public
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Issues
0
Pull requests
0
Actions
Projects
0
Security
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security
Insights
Files
8971920
Documentation
howto
technical
.gitignore
Makefile
SubmittingPatches
asciidoc.conf
build-docdep.perl
callouts.xsl
config.txt
core-tutorial.txt
cvs-migration.txt
diff-format.txt
diff-options.txt
diffcore.txt
everyday.txt
fetch-options.txt
git-add.txt
git-am.txt
git-annotate.txt
git-apply.txt
git-applymbox.txt
git-applypatch.txt
git-archimport.txt
git-bisect.txt
git-blame.txt
git-branch.txt
git-cat-file.txt
git-check-ref-format.txt
git-checkout-index.txt
git-checkout.txt
git-cherry-pick.txt
git-cherry.txt
git-clean.txt
git-clone-pack.txt
git-clone.txt
git-commit-tree.txt
git-commit.txt
git-convert-objects.txt
git-count-objects.txt
git-cvsexportcommit.txt
git-cvsimport.txt
git-cvsserver.txt
git-daemon.txt
git-describe.txt
git-diff-files.txt
git-diff-index.txt
git-diff-stages.txt
git-diff-tree.txt
git-diff.txt
git-fetch-pack.txt
git-fetch.txt
git-fmt-merge-msg.txt
git-format-patch.txt
git-fsck-objects.txt
git-get-tar-commit-id.txt
git-grep.txt
git-hash-object.txt
git-http-fetch.txt
git-http-push.txt
git-imap-send.txt
git-index-pack.txt
git-init-db.txt
git-local-fetch.txt
git-log.txt
git-lost-found.txt
git-ls-files.txt
git-ls-remote.txt
git-ls-tree.txt
git-mailinfo.txt
git-mailsplit.txt
git-merge-base.txt
git-merge-index.txt
git-merge-one-file.txt
git-merge-tree.txt
git-merge.txt
git-mktag.txt
git-mktree.txt
git-mv.txt
git-name-rev.txt
git-pack-objects.txt
git-pack-redundant.txt
git-parse-remote.txt
git-patch-id.txt
git-peek-remote.txt
git-prune-packed.txt
git-prune.txt
git-pull.txt
git-push.txt
git-read-tree.txt
git-rebase.txt
git-receive-pack.txt
git-relink.txt
git-repack.txt
git-repo-config.txt
git-request-pull.txt
git-rerere.txt
git-reset.txt
git-resolve.txt
git-rev-list.txt
git-rev-parse.txt
git-revert.txt
git-rm.txt
git-send-email.txt
git-send-pack.txt
git-sh-setup.txt
git-shell.txt
git-shortlog.txt
git-show-branch.txt
git-show-index.txt
git-show.txt
git-ssh-fetch.txt
git-ssh-upload.txt
git-status.txt
git-stripspace.txt
git-svnimport.txt
git-symbolic-ref.txt
git-tag.txt
git-tar-tree.txt
git-tools.txt
git-unpack-file.txt
git-unpack-objects.txt
git-update-index.txt
git-update-ref.txt
git-update-server-info.txt
git-upload-pack.txt
git-var.txt
git-verify-pack.txt
git-verify-tag.txt
git-whatchanged.txt
git-write-tree.txt
git.txt
gitk.txt
glossary.txt
hooks.txt
howto-index.sh
install-webdoc.sh
merge-options.txt
merge-strategies.txt
pull-fetch-param.txt
repository-layout.txt
sort_glossary.pl
tutorial.txt
urls.txt
arm
compat
contrib
mozilla-sha1
ppc
t
templates
xdiff
.gitignore
COPYING
GIT-VERSION-GEN
INSTALL
Makefile
README
apply.c
blame.c
blob.c
blob.h
builtin-help.c
builtin-log.c
builtin.h
cache.h
cat-file.c
check-ref-format.c
checkout-index.c
clone-pack.c
combine-diff.c
commit-tree.c
commit.c
commit.h
config.c
connect.c
convert-objects.c
copy.c
csum-file.c
csum-file.h
ctype.c
daemon.c
date.c
delta.h
describe.c
diff-delta.c
diff-files.c
diff-index.c
diff-lib.c
diff-stages.c
diff-tree.c
diff.c
diff.h
diffcore-break.c
diffcore-delta.c
diffcore-order.c
diffcore-pickaxe.c
diffcore-rename.c
diffcore.h
entry.c
environment.c
exec_cmd.c
exec_cmd.h
fetch-clone.c
fetch-pack.c
fetch.c
fetch.h
fsck-objects.c
generate-cmdlist.sh
get-tar-commit-id.c
git-add.sh
git-am.sh
git-annotate.perl
git-applymbox.sh
git-applypatch.sh
git-archimport.perl
git-bisect.sh
git-branch.sh
git-checkout.sh
git-cherry.sh
git-clean.sh
git-clone.sh
git-commit.sh
git-compat-util.h
git-count-objects.sh
git-cvsexportcommit.perl
git-cvsimport.perl
git-cvsserver.perl
git-diff.sh
git-fetch.sh
git-fmt-merge-msg.perl
git-format-patch.sh
git-grep.sh
git-lost-found.sh
git-ls-remote.sh
git-merge-octopus.sh
git-merge-one-file.sh
git-merge-ours.sh
git-merge-recursive.py
git-merge-resolve.sh
git-merge-stupid.sh
git-merge.sh
git-mv.perl
git-parse-remote.sh
git-prune.sh
git-pull.sh
git-push.sh
git-rebase.sh
git-relink.perl
git-repack.sh
git-request-pull.sh
git-rerere.perl
git-reset.sh
git-resolve.sh
git-revert.sh
git-rm.sh
git-send-email.perl
git-sh-setup.sh
git-shortlog.perl
git-svnimport.perl
git-tag.sh
git-verify-tag.sh
git-whatchanged.sh
git.c
git.spec.in
gitMergeCommon.py
gitk
hash-object.c
http-fetch.c
http-push.c
http.c
http.h
ident.c
imap-send.c
index-pack.c
index.c
init-db.c
local-fetch.c
log-tree.c
log-tree.h
ls-files.c
ls-tree.c
mailinfo.c
mailsplit.c
merge-base.c
merge-index.c
merge-tree.c
mktag.c
mktree.c
name-rev.c
object.c
object.h
pack-check.c
pack-objects.c
pack-redundant.c
pack.h
pager.c
patch-delta.c
patch-id.c
path.c
peek-remote.c
pkt-line.c
pkt-line.h
prune-packed.c
quote.c
quote.h
read-cache.c
read-tree.c
receive-pack.c
refs.c
refs.h
repo-config.c
rev-list.c
rev-parse.c
revision.c
revision.h
rsh.c
rsh.h
run-command.c
run-command.h
send-pack.c
server-info.c
setup.c
sha1_file.c
sha1_name.c
shell.c
show-branch.c
show-index.c
ssh-fetch.c
ssh-pull.c
ssh-push.c
ssh-upload.c
strbuf.c
strbuf.h
stripspace.c
symbolic-ref.c
tag.c
tag.h
tar-tree.c
tar.h
test-date.c
test-delta.c
tree-diff.c
tree-walk.c
tree-walk.h
tree.c
tree.h
unpack-file.c
unpack-objects.c
update-index.c
update-ref.c
update-server-info.c
upload-pack.c
usage.c
var.c
verify-pack.c
write-tree.c
xdiff-interface.c
xdiff-interface.h
Breadcrumbs
git
/
Documentation
/
git-branch.txt
Blame
Blame
Latest commit
History
History
100 lines (75 loc) · 2.27 KB
Breadcrumbs
git
/
Documentation
/
git-branch.txt
Top
File metadata and controls
Code
Blame
100 lines (75 loc) · 2.27 KB
Raw
git-branch(1) ============= NAME ---- git-branch - List, create, or delete branches. SYNOPSIS -------- [verse] 'git-branch' [-r] 'git-branch' [-f] <branchname> [<start-point>] 'git-branch' (-d | -D) <branchname>... DESCRIPTION ----------- With no arguments given (or just `-r`) a list of available branches will be shown, the current branch will be highlighted with an asterisk. 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>. If no <start-point> is given, the branch will be created with a head equal to that of the currently checked out branch. With a `-d` or `-D` option, `<branchname>` will be deleted. You may specify more than one branch for deletion. OPTIONS ------- -d:: Delete a branch. The branch must be fully merged. -D:: Delete a branch irrespective of its index status. -f:: Force the creation of a new branch even if it means deleting a branch that already exists with the same name. -r:: List only the "remote" branches. <branchname>:: The name of the branch to create or delete. <start-point>:: The new branch will be created with a HEAD equal to this. It may be given as a branch name, a commit-id, or a tag. If this option is omitted, the current branch is assumed. Examples -------- Start development off of a known tag:: + ------------ $ git clone git://git.kernel.org/pub/scm/.../linux-2.6 my2.6 $ cd my2.6 $ git branch my2.6.14 v2.6.14 <1> $ git checkout my2.6.14 ------------ + <1> This step and the next one could be combined into a single step with "checkout -b my2.6.14 v2.6.14". Delete unneeded branch:: + ------------ $ git clone git://git.kernel.org/.../git.git my.git $ cd my.git $ git branch -D todo <1> ------------ + <1> delete todo branch even if the "master" branch does not have all commits from todo branch. Notes ----- If you are creating a branch that you want to immediately checkout, it's easier to use the git checkout command with its `-b` option to create a branch and check it out with a single command. Author ------ Written by Linus Torvalds <torvalds@osdl.org> and Junio C Hamano <junkio@cox.net> Documentation -------------- Documentation by Junio C Hamano and the git-list <git@vger.kernel.org>. GIT --- Part of the gitlink:git[7] suite
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
You can’t perform that action at this time.