2 # bash completion support for core Git.
4 # Copyright (C) 2006,2007 Shawn O. Pearce <spearce@spearce.org>
5 # Conceptually based on gitcompletion (http://gitweb.hawaga.org.uk/).
6 # Distributed under the GNU General Public License, version 2.0.
8 # The contained completion routines provide support for completing:
10 # *) local and remote branch names
11 # *) local and remote tag names
12 # *) .git/remotes file names
13 # *) git 'subcommands'
14 # *) tree paths within 'ref:path/to/file' expressions
15 # *) common --long-options
17 # To use these routines:
19 # 1) Copy this file to somewhere (e.g. ~/.git-completion.sh).
20 # 2) Added the following line to your .bashrc:
21 # source ~/.git-completion.sh
23 # 3) You may want to make sure the git executable is available
24 # in your PATH before this script is sourced, as some caching
25 # is performed while the script loads. If git isn't found
26 # at source time then all lookups will be done on demand,
27 # which may be slightly slower.
29 # 4) Consider changing your PS1 to also show the current branch:
30 # PS1='[\u@\h \W$(__git_ps1 " (%s)")]\$ '
32 # The argument to __git_ps1 will be displayed only if you
33 # are currently in a git repository. The %s token will be
34 # the name of the current branch.
38 # *) Read Documentation/SubmittingPatches
39 # *) Send all patches to the current maintainer:
41 # "Shawn O. Pearce" <spearce@spearce.org>
43 # *) Always CC the Git mailing list:
51 if [ -n "$__git_dir" ]; then
53 elif [ -d .git ]; then
56 git rev-parse --git-dir 2>/dev/null
58 elif [ -d "$1/.git" ]; then
67 local g="$(git rev-parse --git-dir 2>/dev/null)"
71 if [ -d "$g/../.dotest" ]
73 if test -f "$g/../.dotest/rebasing"
76 elif test -f "$g/../.dotest/applying"
82 b="$(git symbolic-ref HEAD 2>/dev/null)"
83 elif [ -f "$g/.dotest-merge/interactive" ]
86 b="$(cat "$g/.dotest-merge/head-name")"
87 elif [ -d "$g/.dotest-merge" ]
90 b="$(cat "$g/.dotest-merge/head-name")"
91 elif [ -f "$g/MERGE_HEAD" ]
94 b="$(git symbolic-ref HEAD 2>/dev/null)"
96 if [ -f "$g/BISECT_LOG" ]
100 if ! b="$(git symbolic-ref HEAD 2>/dev/null)"
102 if ! b="$(git describe --exact-match HEAD 2>/dev/null)"
104 b="$(cut -c1-7 "$g/HEAD")..."
110 printf "$1" "${b##refs/heads/}$r"
112 printf " (%s)" "${b##refs/heads/}$r"
119 local c IFS=' '$'\t'$'\n'
122 --*=*) printf %s$'\n' "$c$2" ;;
123 *.) printf %s$'\n' "$c$2" ;;
124 *) printf %s$'\n' "$c$2 " ;;
131 local cur="${COMP_WORDS[COMP_CWORD]}"
132 if [ $# -gt 2 ]; then
141 COMPREPLY=($(compgen -P "$2" \
142 -W "$(__gitcomp_1 "$1" "$4")" \
150 local cmd i is_hash=y dir="$(__gitdir "$1")"
151 if [ -d "$dir" ]; then
152 for i in $(git --git-dir="$dir" \
153 for-each-ref --format='%(refname)' \
155 echo "${i#refs/heads/}"
159 for i in $(git ls-remote "$1" 2>/dev/null); do
160 case "$is_hash,$i" in
163 n,refs/heads/*) is_hash=y; echo "${i#refs/heads/}" ;;
164 n,*) is_hash=y; echo "$i" ;;
171 local cmd i is_hash=y dir="$(__gitdir "$1")"
172 if [ -d "$dir" ]; then
173 for i in $(git --git-dir="$dir" \
174 for-each-ref --format='%(refname)' \
176 echo "${i#refs/tags/}"
180 for i in $(git ls-remote "$1" 2>/dev/null); do
181 case "$is_hash,$i" in
184 n,refs/tags/*) is_hash=y; echo "${i#refs/tags/}" ;;
185 n,*) is_hash=y; echo "$i" ;;
192 local cmd i is_hash=y dir="$(__gitdir "$1")"
193 if [ -d "$dir" ]; then
194 if [ -e "$dir/HEAD" ]; then echo HEAD; fi
195 for i in $(git --git-dir="$dir" \
196 for-each-ref --format='%(refname)' \
197 refs/tags refs/heads refs/remotes); do
199 refs/tags/*) echo "${i#refs/tags/}" ;;
200 refs/heads/*) echo "${i#refs/heads/}" ;;
201 refs/remotes/*) echo "${i#refs/remotes/}" ;;
207 for i in $(git ls-remote "$dir" 2>/dev/null); do
208 case "$is_hash,$i" in
211 n,refs/tags/*) is_hash=y; echo "${i#refs/tags/}" ;;
212 n,refs/heads/*) is_hash=y; echo "${i#refs/heads/}" ;;
213 n,refs/remotes/*) is_hash=y; echo "${i#refs/remotes/}" ;;
214 n,*) is_hash=y; echo "$i" ;;
222 for i in $(__git_refs "$1"); do
227 __git_refs_remotes ()
229 local cmd i is_hash=y
230 for i in $(git ls-remote "$1" 2>/dev/null); do
231 case "$is_hash,$i" in
234 echo "$i:refs/remotes/$1/${i#refs/heads/}"
238 n,refs/tags/*) is_hash=y;;
246 local i ngoff IFS=$'\n' d="$(__gitdir)"
247 shopt -q nullglob || ngoff=1
249 for i in "$d/remotes"/*; do
250 echo ${i#$d/remotes/}
252 [ "$ngoff" ] && shopt -u nullglob
253 for i in $(git --git-dir="$d" config --list); do
263 __git_merge_strategies ()
265 if [ -n "$__git_merge_strategylist" ]; then
266 echo "$__git_merge_strategylist"
269 sed -n "/^all_strategies='/{
270 s/^all_strategies='//
274 }" "$(git --exec-path)/git-merge"
276 __git_merge_strategylist=
277 __git_merge_strategylist="$(__git_merge_strategies 2>/dev/null)"
279 __git_complete_file ()
281 local pfx ls ref cur="${COMP_WORDS[COMP_CWORD]}"
298 COMPREPLY=($(compgen -P "$pfx" \
299 -W "$(git --git-dir="$(__gitdir)" ls-tree "$ls" \
300 | sed '/^100... blob /{
316 __gitcomp "$(__git_refs)"
321 __git_complete_revlist ()
323 local pfx cur="${COMP_WORDS[COMP_CWORD]}"
328 __gitcomp "$(__git_refs)" "$pfx" "$cur"
333 __gitcomp "$(__git_refs)" "$pfx" "$cur"
336 __gitcomp "$(__git_refs)"
343 if [ -n "$__git_commandlist" ]; then
344 echo "$__git_commandlist"
348 for i in $(git help -a|egrep '^ ')
351 *--*) : helper pattern;;
352 applymbox) : ask gittus;;
353 applypatch) : ask gittus;;
354 archimport) : import;;
355 cat-file) : plumbing;;
356 check-attr) : plumbing;;
357 check-ref-format) : plumbing;;
358 commit-tree) : plumbing;;
359 cvsexportcommit) : export;;
360 cvsimport) : import;;
361 cvsserver) : daemon;;
363 diff-files) : plumbing;;
364 diff-index) : plumbing;;
365 diff-tree) : plumbing;;
366 fast-import) : import;;
367 fsck-objects) : plumbing;;
368 fetch-pack) : plumbing;;
369 fmt-merge-msg) : plumbing;;
370 for-each-ref) : plumbing;;
371 hash-object) : plumbing;;
372 http-*) : transport;;
373 index-pack) : plumbing;;
374 init-db) : deprecated;;
375 local-fetch) : plumbing;;
376 mailinfo) : plumbing;;
377 mailsplit) : plumbing;;
378 merge-*) : plumbing;;
381 pack-objects) : plumbing;;
382 pack-redundant) : plumbing;;
383 pack-refs) : plumbing;;
384 parse-remote) : plumbing;;
385 patch-id) : plumbing;;
386 peek-remote) : plumbing;;
388 prune-packed) : plumbing;;
389 quiltimport) : import;;
390 read-tree) : plumbing;;
391 receive-pack) : plumbing;;
393 repo-config) : deprecated;;
395 rev-list) : plumbing;;
396 rev-parse) : plumbing;;
397 runstatus) : plumbing;;
398 sh-setup) : internal;;
400 send-pack) : plumbing;;
401 show-index) : plumbing;;
403 stripspace) : plumbing;;
404 symbolic-ref) : plumbing;;
405 tar-tree) : deprecated;;
406 unpack-file) : plumbing;;
407 unpack-objects) : plumbing;;
408 update-index) : plumbing;;
409 update-ref) : plumbing;;
410 update-server-info) : daemon;;
411 upload-archive) : plumbing;;
412 upload-pack) : plumbing;;
413 write-tree) : plumbing;;
414 verify-tag) : plumbing;;
420 __git_commandlist="$(__git_commands 2>/dev/null)"
425 for i in $(git --git-dir="$(__gitdir)" config --list); do
435 __git_aliased_command ()
437 local word cmdline=$(git --git-dir="$(__gitdir)" \
438 config --get "alias.$1")
439 for word in $cmdline; do
440 if [ "${word##-*}" ]; then
447 __git_find_subcommand ()
449 local word subcommand c=1
451 while [ $c -lt $COMP_CWORD ]; do
452 word="${COMP_WORDS[c]}"
453 for subcommand in $1; do
454 if [ "$subcommand" = "$word" ]; then
463 __git_has_doubledash ()
466 while [ $c -lt $COMP_CWORD ]; do
467 if [ "--" = "${COMP_WORDS[c]}" ]; then
475 __git_whitespacelist="nowarn warn error error-all strip"
479 local cur="${COMP_WORDS[COMP_CWORD]}"
480 if [ -d .dotest ]; then
481 __gitcomp "--skip --resolved"
486 __gitcomp "$__git_whitespacelist" "" "${cur##--whitespace=}"
491 --signoff --utf8 --binary --3way --interactive
501 local cur="${COMP_WORDS[COMP_CWORD]}"
504 __gitcomp "$__git_whitespacelist" "" "${cur##--whitespace=}"
509 --stat --numstat --summary --check --index
510 --cached --index-info --reverse --reject --unidiff-zero
511 --apply --no-add --exclude=
512 --whitespace= --inaccurate-eof --verbose
521 __git_has_doubledash && return
523 local cur="${COMP_WORDS[COMP_CWORD]}"
527 --interactive --refresh --patch --update --dry-run
537 __git_has_doubledash && return
539 local subcommands="start bad good reset visualize replay log"
540 local subcommand="$(__git_find_subcommand "$subcommands")"
541 if [ -z "$subcommand" ]; then
542 __gitcomp "$subcommands"
546 case "$subcommand" in
548 __gitcomp "$(__git_refs)"
558 local i c=1 only_local_ref="n" has_r="n"
560 while [ $c -lt $COMP_CWORD ]; do
563 -d|-m) only_local_ref="y" ;;
569 case "${COMP_WORDS[COMP_CWORD]}" in
570 --*=*) COMPREPLY=() ;;
573 --color --no-color --verbose --abbrev= --no-abbrev
578 if [ $only_local_ref = "y" -a $has_r = "n" ]; then
579 __gitcomp "$(__git_heads)"
581 __gitcomp "$(__git_refs)"
589 local mycword="$COMP_CWORD"
590 case "${COMP_WORDS[0]}" in
592 local cmd="${COMP_WORDS[2]}"
593 mycword="$((mycword-1))"
596 local cmd="${COMP_WORDS[1]}"
601 __gitcomp "create list-heads verify unbundle"
609 __git_complete_revlist
618 __gitcomp "$(__git_refs)"
623 __gitcomp "$(__git_refs)"
628 local cur="${COMP_WORDS[COMP_CWORD]}"
631 __gitcomp "--edit --no-commit"
634 __gitcomp "$(__git_refs)"
641 __git_has_doubledash && return
643 local cur="${COMP_WORDS[COMP_CWORD]}"
647 --all --author= --signoff --verify --no-verify
648 --edit --amend --include --only
657 __gitcomp "$(__git_refs)"
662 __git_has_doubledash && return
664 local cur="${COMP_WORDS[COMP_CWORD]}"
667 __gitcomp "--cached --stat --numstat --shortstat --summary
668 --patch-with-stat --name-only --name-status --color
669 --no-color --color-words --no-renames --check
670 --full-index --binary --abbrev --diff-filter
671 --find-copies-harder --pickaxe-all --pickaxe-regex
672 --text --ignore-space-at-eol --ignore-space-change
673 --ignore-all-space --exit-code --quiet --ext-diff
675 --no-prefix --src-prefix= --dst-prefix=
676 --base --ours --theirs
686 __gitcomp "$(__git_refs)"
691 local cur="${COMP_WORDS[COMP_CWORD]}"
693 case "${COMP_WORDS[0]},$COMP_CWORD" in
695 __gitcomp "$(__git_remotes)"
698 __gitcomp "$(__git_remotes)"
703 __gitcomp "$(__git_refs)" "" "${cur#*:}"
707 case "${COMP_WORDS[0]}" in
708 git-fetch) remote="${COMP_WORDS[1]}" ;;
709 git) remote="${COMP_WORDS[2]}" ;;
711 __gitcomp "$(__git_refs2 "$remote")"
720 local cur="${COMP_WORDS[COMP_CWORD]}"
724 --stdout --attach --thread
726 --numbered --start-number
731 --full-index --binary
734 --no-prefix --src-prefix= --dst-prefix=
739 __git_complete_revlist
744 local cur="${COMP_WORDS[COMP_CWORD]}"
747 __gitcomp "--prune --aggressive"
756 __gitcomp "$(__git_remotes)"
766 __git_has_doubledash && return
768 local cur="${COMP_WORDS[COMP_CWORD]}"
772 oneline short medium full fuller email raw
773 " "" "${cur##--pretty=}"
778 relative iso8601 rfc2822 short local default
779 " "" "${cur##--date=}"
784 --max-count= --max-age= --since= --after=
785 --min-age= --before= --until=
786 --root --topo-order --date-order --reverse
788 --abbrev-commit --abbrev=
789 --relative-date --date=
790 --author= --committer= --grep=
792 --pretty= --name-status --name-only --raw
794 --left-right --cherry-pick
800 __git_complete_revlist
805 local cur="${COMP_WORDS[COMP_CWORD]}"
806 case "${COMP_WORDS[COMP_CWORD-1]}" in
808 __gitcomp "$(__git_merge_strategies)"
813 __gitcomp "$(__git_merge_strategies)" "" "${cur##--strategy=}"
818 --no-commit --no-stat --log --no-log --squash --strategy
822 __gitcomp "$(__git_refs)"
827 __gitcomp "$(__git_refs)"
832 __gitcomp "--tags --all --stdin"
837 local cur="${COMP_WORDS[COMP_CWORD]}"
839 case "${COMP_WORDS[0]},$COMP_CWORD" in
841 __gitcomp "$(__git_remotes)"
844 __gitcomp "$(__git_remotes)"
848 case "${COMP_WORDS[0]}" in
849 git-pull) remote="${COMP_WORDS[1]}" ;;
850 git) remote="${COMP_WORDS[2]}" ;;
852 __gitcomp "$(__git_refs "$remote")"
859 local cur="${COMP_WORDS[COMP_CWORD]}"
861 case "${COMP_WORDS[0]},$COMP_CWORD" in
863 __gitcomp "$(__git_remotes)"
866 __gitcomp "$(__git_remotes)"
872 case "${COMP_WORDS[0]}" in
873 git-push) remote="${COMP_WORDS[1]}" ;;
874 git) remote="${COMP_WORDS[2]}" ;;
876 __gitcomp "$(__git_refs "$remote")" "" "${cur#*:}"
879 __gitcomp "$(__git_refs)" + "${cur#+}"
882 __gitcomp "$(__git_refs)"
891 local cur="${COMP_WORDS[COMP_CWORD]}" dir="$(__gitdir)"
892 if [ -d .dotest ] || [ -d "$dir"/.dotest-merge ]; then
893 __gitcomp "--continue --skip --abort"
896 case "${COMP_WORDS[COMP_CWORD-1]}" in
898 __gitcomp "$(__git_merge_strategies)"
903 __gitcomp "$(__git_merge_strategies)" "" "${cur##--strategy=}"
907 __gitcomp "--onto --merge --strategy --interactive"
910 __gitcomp "$(__git_refs)"
915 local cur="${COMP_WORDS[COMP_CWORD]}"
916 local prv="${COMP_WORDS[COMP_CWORD-1]}"
919 __gitcomp "$(__git_remotes)"
923 __gitcomp "$(__git_refs)"
927 local remote="${prv#remote.}"
928 remote="${remote%.fetch}"
929 __gitcomp "$(__git_refs_remotes "$remote")"
933 local remote="${prv#remote.}"
934 remote="${remote%.push}"
935 __gitcomp "$(git --git-dir="$(__gitdir)" \
936 for-each-ref --format='%(refname):%(refname)' \
940 pull.twohead|pull.octopus)
941 __gitcomp "$(__git_merge_strategies)"
944 color.branch|color.diff|color.status)
945 __gitcomp "always never auto"
950 black red green yellow blue magenta cyan white
951 bold dim ul blink reverse
963 --global --system --file=
965 --get --get-all --get-regexp
966 --add --unset --unset-all
967 --remove-section --rename-section
972 local pfx="${cur%.*}."
974 __gitcomp "remote merge" "$pfx" "$cur"
978 local pfx="${cur%.*}."
980 __gitcomp "$(__git_heads)" "$pfx" "$cur" "."
984 local pfx="${cur%.*}."
987 url fetch push skipDefaultUpdate
988 receivepack uploadpack tagopt
993 local pfx="${cur%.*}."
995 __gitcomp "$(__git_remotes)" "$pfx" "$cur" "."
1004 core.preferSymlinkRefs
1005 core.logAllRefUpdates
1006 core.loosecompression
1007 core.repositoryFormatVersion
1008 core.sharedRepository
1009 core.warnAmbiguousRefs
1011 core.packedGitWindowSize
1015 color.branch.current
1026 color.diff.whitespace
1031 color.status.changed
1032 color.status.untracked
1037 format.subjectprefix
1041 gitcvs.dbname gitcvs.dbdriver gitcvs.dbuser gitcvs.dbpass
1042 gitcvs.dbtablenameprefix
1045 gc.reflogexpireunreachable
1058 i18n.logOutputEncoding
1068 pack.deltaCacheLimit
1071 repack.useDeltaBaseOffset
1075 transfer.unpackLimit
1077 receive.denyNonFastForwards
1081 whatchanged.difftree
1088 local subcommands="add rm show prune update"
1089 local subcommand="$(__git_find_subcommand "$subcommands")"
1090 if [ -z "$subcommand" ]; then
1091 __gitcomp "$subcommands"
1095 case "$subcommand" in
1097 __gitcomp "$(__git_remotes)"
1100 local i c='' IFS=$'\n'
1101 for i in $(git --git-dir="$(__gitdir)" config --list); do
1119 __git_has_doubledash && return
1121 local cur="${COMP_WORDS[COMP_CWORD]}"
1124 __gitcomp "--mixed --hard --soft"
1128 __gitcomp "$(__git_refs)"
1133 __git_has_doubledash && return
1135 local cur="${COMP_WORDS[COMP_CWORD]}"
1139 --max-count= --max-age= --since= --after=
1140 --min-age= --before= --until=
1142 --author= --committer= --grep=
1145 --numbered --summary
1150 __git_complete_revlist
1155 local cur="${COMP_WORDS[COMP_CWORD]}"
1159 oneline short medium full fuller email raw
1160 " "" "${cur##--pretty=}"
1164 __gitcomp "--pretty="
1173 local subcommands='save list show apply clear drop pop create'
1174 if [ -z "$(__git_find_subcommand "$subcommands")" ]; then
1175 __gitcomp "$subcommands"
1181 __git_has_doubledash && return
1183 local subcommands="add status init update"
1184 if [ -z "$(__git_find_subcommand "$subcommands")" ]; then
1185 local cur="${COMP_WORDS[COMP_CWORD]}"
1188 __gitcomp "--quiet --cached"
1191 __gitcomp "$subcommands"
1201 init fetch clone rebase dcommit log find-rev
1202 set-tree commit-diff info create-ignore propget
1203 proplist show-ignore show-externals
1205 local subcommand="$(__git_find_subcommand "$subcommands")"
1206 if [ -z "$subcommand" ]; then
1207 __gitcomp "$subcommands"
1209 local remote_opts="--username= --config-dir= --no-auth-cache"
1211 --follow-parent --authors-file= --repack=
1212 --no-metadata --use-svm-props --use-svnsync-props
1213 --log-window-size= --no-checkout --quiet
1214 --repack-flags --user-log-author $remote_opts
1217 --template= --shared= --trunk= --tags=
1218 --branches= --stdlayout --minimize-url
1219 --no-metadata --use-svm-props --use-svnsync-props
1220 --rewrite-root= $remote_opts
1223 --edit --rmdir --find-copies-harder --copy-similarity=
1226 local cur="${COMP_WORDS[COMP_CWORD]}"
1227 case "$subcommand,$cur" in
1229 __gitcomp "--revision= --fetch-all $fc_opts"
1232 __gitcomp "--revision= $fc_opts $init_opts"
1235 __gitcomp "$init_opts"
1239 --merge --strategy= --verbose --dry-run
1240 --fetch-all --no-rebase $cmt_opts $fc_opts
1244 __gitcomp "--stdin $cmt_opts $fc_opts"
1246 create-ignore,--*|propget,--*|proplist,--*|show-ignore,--*|\
1248 __gitcomp "--revision="
1252 --limit= --revision= --verbose --incremental
1253 --oneline --show-commit --non-recursive
1259 --merge --verbose --strategy= --local
1260 --fetch-all $fc_opts
1264 __gitcomp "--message= --file= --revision= $cmt_opts"
1279 while [ $c -lt $COMP_CWORD ]; do
1280 i="${COMP_WORDS[c]}"
1283 __gitcomp "$(__git_tags)"
1293 case "${COMP_WORDS[COMP_CWORD-1]}" in
1299 __gitcomp "$(__git_tags)"
1305 __gitcomp "$(__git_refs)"
1312 local i c=1 command __git_dir
1314 while [ $c -lt $COMP_CWORD ]; do
1315 i="${COMP_WORDS[c]}"
1317 --git-dir=*) __git_dir="${i#--git-dir=}" ;;
1318 --bare) __git_dir="." ;;
1319 --version|--help|-p|--paginate) ;;
1320 *) command="$i"; break ;;
1325 if [ -z "$command" ]; then
1326 case "${COMP_WORDS[COMP_CWORD]}" in
1327 --*=*) COMPREPLY=() ;;
1339 *) __gitcomp "$(__git_commands) $(__git_aliases)" ;;
1344 local expansion=$(__git_aliased_command "$command")
1345 [ "$expansion" ] && command="$expansion"
1350 apply) _git_apply ;;
1351 bisect) _git_bisect ;;
1352 bundle) _git_bundle ;;
1353 branch) _git_branch ;;
1354 checkout) _git_checkout ;;
1355 cherry) _git_cherry ;;
1356 cherry-pick) _git_cherry_pick ;;
1357 commit) _git_commit ;;
1358 config) _git_config ;;
1359 describe) _git_describe ;;
1361 fetch) _git_fetch ;;
1362 format-patch) _git_format_patch ;;
1365 ls-remote) _git_ls_remote ;;
1366 ls-tree) _git_ls_tree ;;
1368 merge-base) _git_merge_base ;;
1369 name-rev) _git_name_rev ;;
1372 rebase) _git_rebase ;;
1373 remote) _git_remote ;;
1374 reset) _git_reset ;;
1375 shortlog) _git_shortlog ;;
1377 show-branch) _git_log ;;
1378 stash) _git_stash ;;
1379 submodule) _git_submodule ;;
1382 whatchanged) _git_log ;;
1389 __git_has_doubledash && return
1391 local cur="${COMP_WORDS[COMP_CWORD]}"
1392 local g="$(git rev-parse --git-dir 2>/dev/null)"
1394 if [ -f $g/MERGE_HEAD ]; then
1399 __gitcomp "--not --all $merge"
1403 __git_complete_revlist
1406 complete -o default -o nospace -F _git git
1407 complete -o default -o nospace -F _gitk gitk
1408 complete -o default -o nospace -F _git_am git-am
1409 complete -o default -o nospace -F _git_apply git-apply
1410 complete -o default -o nospace -F _git_bisect git-bisect
1411 complete -o default -o nospace -F _git_branch git-branch
1412 complete -o default -o nospace -F _git_bundle git-bundle
1413 complete -o default -o nospace -F _git_checkout git-checkout
1414 complete -o default -o nospace -F _git_cherry git-cherry
1415 complete -o default -o nospace -F _git_cherry_pick git-cherry-pick
1416 complete -o default -o nospace -F _git_commit git-commit
1417 complete -o default -o nospace -F _git_describe git-describe
1418 complete -o default -o nospace -F _git_diff git-diff
1419 complete -o default -o nospace -F _git_fetch git-fetch
1420 complete -o default -o nospace -F _git_format_patch git-format-patch
1421 complete -o default -o nospace -F _git_gc git-gc
1422 complete -o default -o nospace -F _git_log git-log
1423 complete -o default -o nospace -F _git_ls_remote git-ls-remote
1424 complete -o default -o nospace -F _git_ls_tree git-ls-tree
1425 complete -o default -o nospace -F _git_merge git-merge
1426 complete -o default -o nospace -F _git_merge_base git-merge-base
1427 complete -o default -o nospace -F _git_name_rev git-name-rev
1428 complete -o default -o nospace -F _git_pull git-pull
1429 complete -o default -o nospace -F _git_push git-push
1430 complete -o default -o nospace -F _git_rebase git-rebase
1431 complete -o default -o nospace -F _git_config git-config
1432 complete -o default -o nospace -F _git_remote git-remote
1433 complete -o default -o nospace -F _git_reset git-reset
1434 complete -o default -o nospace -F _git_shortlog git-shortlog
1435 complete -o default -o nospace -F _git_show git-show
1436 complete -o default -o nospace -F _git_stash git-stash
1437 complete -o default -o nospace -F _git_submodule git-submodule
1438 complete -o default -o nospace -F _git_svn git-svn
1439 complete -o default -o nospace -F _git_log git-show-branch
1440 complete -o default -o nospace -F _git_tag git-tag
1441 complete -o default -o nospace -F _git_log git-whatchanged
1443 # The following are necessary only for Cygwin, and only are needed
1444 # when the user has tab-completed the executable name and consequently
1445 # included the '.exe' suffix.
1447 if [ Cygwin = "$(uname -o 2>/dev/null)" ]; then
1448 complete -o default -o nospace -F _git_add git-add.exe
1449 complete -o default -o nospace -F _git_apply git-apply.exe
1450 complete -o default -o nospace -F _git git.exe
1451 complete -o default -o nospace -F _git_branch git-branch.exe
1452 complete -o default -o nospace -F _git_bundle git-bundle.exe
1453 complete -o default -o nospace -F _git_cherry git-cherry.exe
1454 complete -o default -o nospace -F _git_describe git-describe.exe
1455 complete -o default -o nospace -F _git_diff git-diff.exe
1456 complete -o default -o nospace -F _git_format_patch git-format-patch.exe
1457 complete -o default -o nospace -F _git_log git-log.exe
1458 complete -o default -o nospace -F _git_ls_tree git-ls-tree.exe
1459 complete -o default -o nospace -F _git_merge_base git-merge-base.exe
1460 complete -o default -o nospace -F _git_name_rev git-name-rev.exe
1461 complete -o default -o nospace -F _git_push git-push.exe
1462 complete -o default -o nospace -F _git_config git-config
1463 complete -o default -o nospace -F _git_shortlog git-shortlog.exe
1464 complete -o default -o nospace -F _git_show git-show.exe
1465 complete -o default -o nospace -F _git_log git-show-branch.exe
1466 complete -o default -o nospace -F _git_tag git-tag.exe
1467 complete -o default -o nospace -F _git_log git-whatchanged.exe