Last active
April 17, 2024 14:57
-
-
Save tony-sol/00eb6393b1df1b70d90c07ddd937434f to your computer and use it in GitHub Desktop.
Revisions
-
tony-sol revised this gist
Apr 17, 2024 . No changes.There are no files selected for viewing
-
tony-sol created this gist
Apr 17, 2024 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,10 @@ #!/bin/zsh set -e git_get_head() { (git symbolic-ref "refs/remotes/${@}/HEAD" --short || git remote show "${@}" ) 2>/dev/null | grep "${@}/\|HEAD branch" | sed -E "s#${@}/|HEAD branch:##" | sed 's# ##g' } git_get_head "${1}" exit 0