cdgit: cd relative to git workdir root
- From
- Thomas Koch <thomas-5j3myg3oo4w@public.gmane.org>
- Date
- Sep 16, 2013, 19:01 UTC
- Message-ID
- <201309162101.14879.thomas@koch.ro>
Hi,
I frequently have the need to cd back to the root of the current git workdir and created to alias for this:
git alias root = rev-parse --show-toplevel
shell alias cdgit = cd $(git root)
Maybe somebody likes this.
Now it would be cool, to have an alias to cd into a specific subdir of the git worktree and have zsh (or bash) auto completion for this like
git clone git://git.kernel.org/pub/scm/git/git.git cd git/gitweb/static/js/lib (just to be somewhere deep) cdgit con<tab>/com<tab> (becomes: cdgit contrib/completion)
Somebody with zsh/bash skills who already did this?
Regards, Thomas Koch