File tree Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,8 @@ GitHub Repo : https://github.com/Magnus167/git-aliases
17
17
cop = " ! f() { git checkout $1 && git pull; }; f "
18
18
cob = checkout -b
19
19
branchr = branch --sort=-committerdate
20
+ prunegone = ! git fetch --prune && git branch -vv | awk ' /: gone]/{print $1}' | xargs -r git branch -d
21
+
20
22
pr = " ! f() { BRANCH=$( git branch --show-current) ; REPOURL=$( git config --get remote.origin.url) ; python ~ /git-aliases/python/getpr.py $REPOURL $BRANCH ; }; f "
21
23
co-pr = " ! f() { REPOURL=$( git config --get remote.origin.url) ; BRANCH=$( python ~ /git-aliases/python/checkoutpr.py $REPOURL $1 ) ; git checkout $BRANCH ; git pull; }; f "
22
24
```
Original file line number Diff line number Diff line change
1
+ # # prunegone
2
+ # ## Usage:
3
+ # ```bash
4
+ # git prunegone
5
+ # ```
6
+ # ## Intended use
7
+ # Use this alias to delete all branches that are gone on the remote.
8
+ # It does not delete branches that are not gone on the remote, or are
9
+ # not on the remote at all.
10
+ #
11
+ # Running this alias executes:
12
+ # ```bash
13
+ # git fetch --prune
14
+ # git branch -vv | awk "/: gone]/{print \$1}" | xargs -r git branch -d
15
+ # ```
16
+
17
+ git config --global alias.prunegone ' !git fetch --prune && git branch -vv | awk "/: gone]/{print \$1}" | xargs -r git branch -d'
You can’t perform that action at this time.
0 commit comments