-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #133 from felipealfonsog/development
Updates
- Loading branch information
Showing
1 changed file
with
21 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/bin/bash | ||
|
||
# Automatically detect the base directory from where the script is executed | ||
base_dir=$(pwd) | ||
|
||
echo "Searching for repositories in the base directory: $base_dir" | ||
|
||
# Function to list branches of a Git repository | ||
list_branches() { | ||
local repo_path="$1" | ||
echo "=== Branches in $repo_path ===" | ||
cd "$repo_path" || return | ||
git branch -a | ||
echo "" | ||
} | ||
|
||
# Automatically find Git repositories and list branches | ||
find "$base_dir" -type d -name ".git" | while read -r git_dir; do | ||
repo_path=$(dirname "$git_dir") # Get the repository path | ||
list_branches "$repo_path" | ||
done |