Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?

share|improve this question
add comment

2 Answers

git init
for f in *; do
    [[ -d $f ]] && git submodule add "./$f" "$f"
done
share|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
add comment
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
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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