Skip to content

Instantly share code, notes, and snippets.

@nicwolff
Last active September 29, 2015 20:38
Show Gist options
  • Select an option

  • Save nicwolff/1663989 to your computer and use it in GitHub Desktop.

Select an option

Save nicwolff/1663989 to your computer and use it in GitHub Desktop.
tcsh Git completion rules
set complete = enhance
complete git "p/1/(commit branch remote merge pull push amend clone grep rebase reset bisect diff clone blame log checkout fetch status wdiff symbolic-ref reflog delete-merged)/" \
'n/br/`git branch|cut -c 3-|xargs echo --contains`/' 'N/br/`git branch|cut -c 3-`/' \
'n/cb/`git branch|cut -c 3-`/' \
'n/branch/`git branch|cut -c 3-`/' 'N/branch/`git branch|cut -c 3-`/' \
'n/co/`git branch|cut -c 3-`/' \
'N/symbolic-ref/`git branch|cut -c 3-`/' \
'n/merge/`git branch|cut -c 3-|xargs echo --no-ff --ff-only --squash`/' \
'N/merge/`git branch|cut -c 3-`/' \
'n/rebase/`git branch|cut -c 3-| xargs echo --continue --abort --onto --skip --interactive`/' \
'N/rebase/`git branch|cut -c 3-`/' \
'n/log/(--stat --author)/' \
'n/lh/(--stat --author)/' \
'n/commit/(--amend)/' \
'n/diff/(--cached --no-prefix --color-words --name-only)/' \
'n/pull/(--rebase --no-ff --squash)/' \
'n/fetch/`git remote`/' \
'n/reset/(HEAD^)/' \
'N/reset/(HEAD^)/' \
'n/stash/(apply list save pop clear)/' \
'n/push/`git remote`/' 'N/push/`git branch|cut -c 3-`/' \
'n/remote/(show add rm prune update)/' 'N/remote/`git remote`/'
@marckhouzam
Copy link
Copy Markdown

Note that git 1.8.1 will have a first version of support for tcsh-completion as mentioned below:
http://marc.info/?l=git&m=135456897811682&w=2

You can find the script, git-completion.tcsh, and the necessary accompanying bash script, git-completion.bash, here:
https://github.com/git/git/tree/master/contrib/completion

Some improvements are still being worked on.

Marc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment