Last active
January 3, 2023 22:46
-
-
Save Dylancyclone/f53bd09eed37b3bdfd451e44913a001c to your computer and use it in GitHub Desktop.
Display git repo info on browse using `o2sh/onefetch`
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
LAST_REPO="" | |
cd() { builtin cd "$@" git rev-parse 2>/dev/null | |
if [ $? -eq 0 ]; then | |
if [ "$LAST_REPO" != $(basename $(git rev-parse --show-toplevel)) ]; then | |
onefetch | |
LAST_REPO=$(basename $(git rev-parse --show-toplevel)) | |
fi | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
For usage with onefetch to see git repo information on the command line