Skip to content

Instantly share code, notes, and snippets.

@vispar-tech
Created July 16, 2024 21:01
Show Gist options
  • Save vispar-tech/8abc7e78c880d1e9af1f9a4a831a3fe0 to your computer and use it in GitHub Desktop.
Save vispar-tech/8abc7e78c880d1e9af1f9a4a831a3fe0 to your computer and use it in GitHub Desktop.
Сhecks that the folder name matches the git origin of the project
for dir in $(find . -type d -name ".git"); do
repo_dir=$(dirname "$dir")
repo_name=$(basename "$repo_dir")
remote_url=$(cd "$repo_dir" && git remote get-url origin)
remote_repo_name=$(basename "$remote_url" .git)
if [ "$repo_name" != "$remote_repo_name" ]; then
echo "$repo_dir - $remote_url"
else
echo "$repo_dir - Is okay";
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment