Created
November 25, 2015 16:12
-
-
Save rnagle/8599f3a6f3de8b3ccd9f to your computer and use it in GitHub Desktop.
Get path to the git conf file for the current repository
This file contains hidden or 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/bash | |
function gitconf() { | |
if [[ -d .git ]] | |
then | |
echo ".git/config" | |
return 0; | |
fi | |
if [[ -f .git ]] | |
then | |
echo "$(cat .git | awk '{print $2}')/config" | |
return 0; | |
fi | |
echo "Must be run from a git repository" | |
return 1; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment