Last active
May 2, 2024 11:08
-
-
Save Hfreitas/227881135b0535e6d8a1d0d261248a98 to your computer and use it in GitHub Desktop.
get git repo ref's and upadte branches
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
mkcd() { | |
case "$1" in /*) : ;; *) set -- "./$1" ;; esac | |
mkdir -pv "$1" && cd "$1" | |
} | |
git-update-repo() { | |
git fetch -p && for branch in $(git for-each-ref --format '%(refname) %(upstream:track)' refs/heads | awk '$2 == "[gone]" {sub("refs/heads/", "", $1); print $1}'); do git branch -D $branch; done | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment