Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


little polish to follow standard Git conventions #5

merged 1 commit into from

2 participants

Jeremy Johnstone Elliott Carlson
Jeremy Johnstone

This makes it fit in with the rest of the Git porcelain and uses the completion stuff already bundled in git-completion rather than directly using Git (which could possibly be not future proof).

Elliott Carlson elliottcarlson merged commit 26c8320 into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jan 22, 2014
  1. Jeremy Johnstone
This page is out of date. Refresh to see the latest.
@@ -5,11 +5,11 @@ Delete one or more branches both locally and remotely.
- $ [branchname1] [branchnameX]
+ $ git delete-branch [branchname1] [branchnameX]
Example output:
- $ [branchname]
+ $ git delete-branch [branchname]
[branchname] branch last updated: 8 weeks ago
Are you sure you want to delete the local [branchname] branch? <Y>es or <N>o
@@ -20,20 +20,22 @@ Example output:
Remote branch [branchname] deleted.
-Add git branch tab completion.
-Included is an additional bash script to add tab completion of branch names. You can either
-run it in the current environment for the current terminal session, or by adding it to your
-.bashrc file.
+Simply copy this script into a directory on your path (/usr/local/bin for example) and then
+give it executable permissions (```chmod 755 /usr/local/bin/git-delete-branch```).
-Current terminal session:
+Optional git branch tab completion.
- $ . ./
+This depends on the standard `````` script available commonly on the Internet.
+Just add this to the file and get auto-completion of branch names.
-.bashrc line:
- source /path/to/
-Once you have added the autocompletion script, you can simply type and then press
-TAB twice to list the branches available or to complete the branch name you have started to type.
+ _git_delete_branch ()
+ {
+ __git_complete_strategy && return
+ __gitcomp_nl "$(__git_refs)"
+ }
@@ -1,11 +0,0 @@
-#!/usr/bin/env bash
- local cur="${COMP_WORDS[COMP_CWORD]}"
- local running=`git for-each-ref --format='%(refname:short)' --sort='refname:short' refs/heads`
- COMPREPLY=( $(compgen -W "${running}" -- ${cur}) )
- return 0
-complete -F _deletebranch_autocomplete
0  → git-delete-branch
File renamed without changes
Something went wrong with that request. Please try again.