Skip to content

Instantly share code, notes, and snippets.

@avidal
Created February 8, 2011 17:03
Show Gist options
  • Save avidal/816758 to your computer and use it in GitHub Desktop.
Save avidal/816758 to your computer and use it in GitHub Desktop.
# this is an alias you can drop in your .bashrc (or .profile or .bash_profile or .zshrc or whatever) that'll let
# you use the command `cdp` to cd to the root of your project.
alias cdp='git rev-parse --show-toplevel 2&> /dev/null && cd $(git rev-parse --show-toplevel 2&> /dev/null) || echo "Not a git repository." && test'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment