Open ls12styler opened 12 years ago
You can add this with cd $(git rev-parse --git-dir)/..
for normal repos with .git inside the directory.
git-sh leverages the shell alias function (type 'alias' while in git-sh to see) and '~' is a shell metacharacter, not available for alias names.
I suggest adding the following line to your .gitshrc file (building on the answer from @Daenyth): alias root='cd $(git rev-parse --git-dir)/..'
A more robust one is git rev-parse --show-toplevel
As this integrates into the users shell, I think it would be beneficial for the command 'cd ~' (which would usually cd to the users home directory) to cd to the projects root directory instead.