Skip to content

Commit 89df1d7

Browse files
committed
allow gitcd to accept a parameter, and add completion
Thanks to Thomas Koch for the idea (not sure why I didn't think of this myself) http://lists.madduck.net/pipermail/vcs-home/2013-September/000882.html
1 parent 95310f3 commit 89df1d7

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

.zsh/functions/_gitcd

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#compdef gitcd
2+
3+
_path_files -/ -W $(git root)

.zsh/functions/gitcd

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
#autoload
22

3-
cd `git root`
3+
root=$( git root )
4+
cd "$root/$1"

0 commit comments

Comments
 (0)