Thread (2 messages) flat view 2 messages, 2 authors, 2016-06-15

cdgit: cd relative to git workdir root

From: Thomas Koch <hidden>
Date: 2016-06-15 22:58:46

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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help