From 2969f228a74798fd3b534b0e737cf8bc346a390e Mon Sep 17 00:00:00 2001 From: Oliver Date: Tue, 8 Apr 2025 16:45:55 +0200 Subject: [PATCH] feat(custom-commands): add function to pull all branches --- omz-custom/custom_commands.sh | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/omz-custom/custom_commands.sh b/omz-custom/custom_commands.sh index 90de0aa..f1c2856 100755 --- a/omz-custom/custom_commands.sh +++ b/omz-custom/custom_commands.sh @@ -382,3 +382,25 @@ function learning_time() { echo -e "Total extra learning time used: ${RED}${LEARNING_DIFF#-} hours${NC}" fi } + +# git pull all branches +function gpla() { + + # Define an array of branches to pull + branches=("master" "main" "release" "beta" "acceptance") + + git pull + # Fetch each branch without switching + for branch in "${branches[@]}"; do + echo "Fetching latest changes for branch: $branch" + + # Fetch and update the branch, skipping if it doesn't exist + if git fetch origin "$branch:$branch" 2>/dev/null; then + echo "Successfully updated $branch." + else + echo "Branch $branch does not exist on origin. Skipping..." + fi + done + + echo "Finished fetching branches." +}