feat(git): merge gitf c with gitf d for branch cleanup after pull

This commit is contained in:
Victor Westerlund 2025-12-08 18:48:26 +01:00
parent 256f1fe105
commit 9a7acb86a0
Signed by: vlw
GPG key ID: D0AD730E1057DFC6

View file

@ -161,17 +161,15 @@ gitf () {
gitf gitf
;; ;;
# Clear local branches that have no upstream on remote (cleanup)
"c")
git fetch -p && git branch -vv | awk '/: gone]/{print $1}' | xargs git branch -D
;;
# Pull current branch from a remote (defaults to "origin"). "d" for download. # Pull current branch from a remote (defaults to "origin"). "d" for download.
"d") "d")
local remote="${2:-origin}" local remote="${2:-origin}"
git pull "$remote" $(git rev-parse --abbrev-ref HEAD) git pull "$remote" $(git rev-parse --abbrev-ref HEAD)
git submodule update --recursive git submodule update --recursive
# Delete local branches that used to be tracked on the remote but are now gone (deleted from remote)
git fetch -p && git branch -vv | awk '/: gone]/{print $1}' | xargs git branch -D
;; ;;
# Update all git submodules in this repo. "sd" for submodule download. # Update all git submodules in this repo. "sd" for submodule download.