Skip to content

Instantly share code, notes, and snippets.

View vispar-tech's full-sized avatar

Даниил Павлович vispar-tech

View GitHub Profile
@vispar-tech
vispar-tech / check-origins.sh
Created July 16, 2024 21:01
С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