3.6 KiB
odex25-standard-modules
This Repo contains general standard modules for all projects.
If you want to install each branch in separate directory, use the below:
- First: clone the full repo, say you named it
complete-odex25-standard-modules-repo - Second:
$cd complete-odex25-standard-modules-repo - Then do the following:
Each script will create a ceparate dir for each branch but outside
complete-odex25-standard-modules-repo
- Inside the dir
complete-odex25-standard-modules-repo, create a file namedcheckout_branches.shand writes the script content into it:#!/bin/bash # List all branches that start with "dev" and check out each branch into a separate directory for branch in $(git branch -r | grep "origin/dev" | sed "s|origin/||"); do # Create a new directory for each branch mkdir "../${branch}" # Check out the branch into the newly created directory git worktree add "../${branch}" $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 # Create a new directory for each branch mkdir "../${branch}" # Check out the branch into the newly created directory git worktree add "../${branch}" $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 # Create a new directory for each branch mkdir "../${branch}" # Check out the branch into the newly created directory git worktree add "../${branch}" $branch done - Run the script by:
$./checkout_branches.sh - Output will be like:
master_odex25_hr-preprod_odex25_hr-dev_odex25_hr- ...
If you want to
Extract the directory name without 'dev_' prefixfor branch in $(git branch -r | grep 'origin/dev' | sed 's|origin/||'); do # Extract the directory name without 'dev_' prefix dir_name=$(echo $branch | sed 's|^dev_||') mkdir "../${dir_name}" git worktree add "../${dir_name}" $branch done
- Output will be like:
odex25_hr- ...
Branches:
-
dev_odex-event
-
dev_odex25_accounting
-
dev_odex25_base
-
dev_odex25_dms
-
dev_odex25_fleet
-
dev_odex25_helpdesk
-
dev_odex25_hr
-
dev_odex25_inventory
-
dev_odex25_maintenance
-
dev_odex25_mobile
-
dev_odex25_pos
-
dev_odex25_project
-
dev_odex25_purchase
-
dev_odex25_realstate
-
dev_odex25_sales
-
dev_odex25_survey
-
dev_odex25_transactions
-
dev_odex25_website
-
dev_openeducat_erp-14.0.1.0
-
preprod_odex-event
-
preprod_odex25_accounting
-
preprod_odex25_base
-
preprod_odex25_dms
-
preprod_odex25_fleet
-
preprod_odex25_helpdesk
-
preprod_odex25_hr
-
preprod_odex25_inventory
-
preprod_odex25_maintenance
-
preprod_odex25_mobile
-
preprod_odex25_pos
-
preprod_odex25_project
-
preprod_odex25_purchase
-
preprod_odex25_realstate
-
preprod_odex25_sales
-
preprod_odex25_survey
-
preprod_odex25_transactions
-
preprod_odex25_website
-
preprod_openeducat_erp-14.0.1.0
-
master_odex-event
-
master_odex25_accounting
-
master_odex25_base
-
master_odex25_dms
-
master_odex25_fleet
-
master_odex25_helpdesk
-
master_odex25_hr
-
master_odex25_inventory
-
master_odex25_maintenance
-
master_odex25_mobile
-
master_odex25_pos
-
master_odex25_project
-
master_odex25_purchase
-
master_odex25_realstate
-
master_odex25_sales
-
master_odex25_survey
-
master_odex25_transactions
-
master_odex25_website
-
master_openeducat_erp-14.0.1.0