Last active
April 10, 2017 16:28
-
-
Save somidad/3759c8289ccc9376d56550f14ace58bb to your computer and use it in GitHub Desktop.
A shortcut to git root
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This git alias allows you to move | |
# to the root of a local git repository | |
# (if you are in the repo) | |
# define a shortcut to git root | |
git config --global alias.root 'rev-parse --show-toplevel' | |
# Usage: go to the git root | |
cd $(git root) | |
# Usage: add all under the git root | |
git add $(git root) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment