Skip to content

Instantly share code, notes, and snippets.

@JonasGao
Created November 10, 2019 08:54
Show Gist options
  • Save JonasGao/e2d6f09989cdd632971da5d00d03cb20 to your computer and use it in GitHub Desktop.
Save JonasGao/e2d6f09989cdd632971da5d00d03cb20 to your computer and use it in GitHub Desktop.
find git repo
#!/bin/bash
find ${1} -type d -maxdepth ${2} | while read line; do
git_dir="${line}/.git"
if [[ -d ${git_dir} ]]; then
echo $line
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment