From 0dd52ca925fddbaf366bb657ac23ef749aad8be5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D8=B4=D8=B1=D9=83=D8=A9=20=D8=AE=D8=A8=D9=8A=D8=B1=20?= =?UTF-8?q?=D8=A7=D9=84=D9=85=D8=AD=D8=AF=D9=88=D8=AF=D8=A9?= Date: Sun, 18 Aug 2024 13:44:00 +0300 Subject: [PATCH] Delete checkout_branches_full_names.sh --- checkout_branches_full_names.sh | 42 --------------------------------- 1 file changed, 42 deletions(-) delete mode 100755 checkout_branches_full_names.sh diff --git a/checkout_branches_full_names.sh b/checkout_branches_full_names.sh deleted file mode 100755 index 691fa3993..000000000 --- a/checkout_branches_full_names.sh +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/bash - -# Prune worktree references to remove any missing worktrees -git worktree prune - -# Function to add worktree and check out branch -add_worktree_and_checkout() { - local branch=$1 - - # Create the directory if it doesn't exist - mkdir -p "../${branch}" - - # Add the worktree - git worktree add "../${branch}" "origin/${branch}" || { - echo "Failed to add worktree for branch ${branch}" - return 1 - } - - # Change to the new worktree directory and check out the branch - cd "../${branch}" - git checkout "${branch}" || { - echo "Failed to checkout branch ${branch} in directory ${branch}" - return 1 - } - cd - > /dev/null -} - -# List remote branches that start with 'origin/dev' -for branch in $(git branch -r | grep 'origin/dev' | sed 's|origin/||'); do - add_worktree_and_checkout "${branch}" -done - -# List all branches that start with "preprod" and check out each branch into a separate directory -for branch in $(git branch -r | grep 'origin/preprod' | sed 's|origin/||'); do - add_worktree_and_checkout "${branch}" -done - -# List all branches that start with "master" and check out each branch into a separate directory -for branch in $(git branch -r | grep 'origin/master' | grep -vE 'origin/(HEAD|master$)' | sed 's|origin/||'); do - add_worktree_and_checkout "${branch}" -done -