Skip to content

Commit 9ef819a

Browse files
committed
ezk.git function to get all remote branches
1 parent 9b36fb7 commit 9ef819a

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

EasyKey.git/ezk-git-functions.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -421,3 +421,9 @@ ammendCommit() {
421421
prettyLog() {
422422
git log --all --graph --decorate --oneline --format='%C(auto)%ad %h %d %C(bold blue)%an%Creset %s %C(bold red)%D' --date=format:'%Y-%m-%d %H:%M'
423423
}
424+
425+
allBranches() {
426+
git branch -r | grep -v '\->' | sed "s,\x1B\[[0-9;]*[a-zA-Z],,g" | while read remote; do git branch --track "${remote#origin/}" "$remote"; done
427+
executeCommand "git fetch --all"
428+
executeCommand "git pull --all"
429+
}

EasyKey.git/git.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ menuInit "EasyKey.git"
1919
menuItemClm l "Show all commits log" prettyLog p "Show all branches (incl. remote)" showAllBranches
2020
menuItemClm v "Checkout remote branch" coRemoteBranch n "Delete local/remote branch" deleteBranch
2121
menuItemClm k "New local/remote branch checkout" newLocalBranch c "Change commit messages" ammendCommit
22-
menuItem o "Merge source to target branch" mergeSourceToTarget
22+
menuItemClm o "Merge source to target branch" mergeSourceToTarget z "Get all remote branches" allBranches
2323
submenuHead "Other usefull actions "
2424
menuItemClm s "Working with diffs" workingDiffs w "Working with commits" atlassiansView
2525
menuItemClm y "Setting up repositories" settingUp 5 "Git extras" gitExtras

0 commit comments

Comments
 (0)