aboutsummaryrefslogtreecommitdiff
path: root/git-submodule-move-all-git-dirs
blob: 41a7352d19340649dc720147bef3ac3b9b4f49a5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/bash
#
# Call git-submodule-move-git-dir for each repository in a tree
#

# Parameters
BASENAME="`basename $0`"

# Checks
if [ ! -e ".git" ]; then
  echo "please run this command in the top-level repository folder"
  exit 1
fi

# If we invert find results so we begin conversion at the toplevel folders
#find -type f -name .git | tac | while read repo; do
find -type f -name .git | while read repo; do
  folder="`dirname $repo`"
  git-submodule-move-git-dir $folder
done