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?

link|improve this question

62% accept rate
feedback

2 Answers

git init
for f in *; do
    [[ -d $f ]] && git submodule add "./$f" "$f"
done
link|improve this answer
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
feedback
up vote 0 down vote accepted

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
link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.