Subject: cdgit: cd relative to git workdir root

From: Thomas Koch <[email-masked]>
Date: Mon, 16 Sep 2013 21:01:14 +0200

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