0

My case is ~/Library/Application Support/TextMate/Pristine Copy/Bundles there I have some bundles/folders which are all git repos. If I create git repo at Bundles folder, which will be the easiest/fastest way to add all bundles as submodules to this repo?

tig
  • 4,624
  • 4
  • 34
  • 49

2 Answers2

0
git init
for f in *; do
    [[ -d $f ]] && git submodule add "./$f" "$f"
done
u1686_grawity
  • 426,297
  • 64
  • 894
  • 966
  • Got `remote (origin) does not have a url defined in .git/config` for every repository. As I understand relative form for repository assumes that all repos are in one location, but this is not my case. – tig Mar 26 '11 at 23:22
0

Got it working this way:

git init
for f in */**/.git; do
  git submodule add "$(git --git-dir="$f" config remote.origin.url)" "$(dirname "$f")"
done
tig
  • 4,624
  • 4
  • 34
  • 49