mirror of
https://codeberg.org/vlw/dotfiles.git
synced 2026-01-11 21:36:00 +01:00
feat(git): merge gitf c with gitf d for gone branch cleanup after pull (#75)
Reviewed-on: https://codeberg.org/vlw/dotfiles/pulls/75
This commit is contained in:
parent
256f1fe105
commit
b25d305ca2
1 changed files with 3 additions and 5 deletions
|
|
@ -161,17 +161,15 @@ 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.
|
||||
"d")
|
||||
local remote="${2:-origin}"
|
||||
|
||||
git pull "$remote" $(git rev-parse --abbrev-ref HEAD)
|
||||
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.
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue