Created
March 11, 2015 16:23
-
-
Save das-g/0c66b2575a189a339e72 to your computer and use it in GitHub Desktop.
script that can be used as git hook AND can be called manually
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
#!/bin/sh | |
GIT_DIR=${GIT_DIR:=$(git rev-parse --git-dir)} | |
GIT_WORK_TREE=${GIT_WORK_TREE:=$GIT_DIR/..} | |
cd $GIT_WORK_TREE | |
# Do something that depends on current working dir being the git work tree's root ... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment