Sometimes I'm deeply nested in the directory structure of a git repo and I want to quickly switch to the topmost directory (you know, the one that has a .git
subdirectory).
Put this in your .bashrc
, run source .bashrc
, then run it:
~/project_name/public/stylesheets/widgets $ rcd
~/project_name $
cd
git rev-parse --show-toplevel
# includes helpful error message