Skip to content

Instantly share code, notes, and snippets.

@Asenar Asenar/gist:5246483
Last active Dec 15, 2015

Embed
What would you like to do?
mkdir ~/tmp_working_dir
cd ~/tmp_working_dir
git init full_smalte
cd full_smalte
all_subs="installer framework module.sample tests theme.backoffice theme.frontoffice"
# part 1 : import all
# Six branch doomed to die
for i in $all_subs; do
git remote add "${i/./-}"_origin https://github.com/Smalte/$i.git
done
git fetch --all
git checkout -b megamerge
# part 2 : one branch to govern them all
for i in $all_subs; do
# get theses datas
git merge ${i/./-}
# move them to the correct dir (can be improved)
mkdir ../${i/./-}
mv * ../${i/./-}/
mv ../${i/./-} ./
# this will handle all git add and git rm
git add .
git commit --m "imported $i"
done
git commit --allow-empty -m "all submodules imported into main repository"
# now removing old references
for i in $all_subs; do
git remote rm "${i/./-}"_origin
done
git remote add origin git@github.com:Smalte/Smalte
git push origin new_develop
@Asenar

This comment has been minimized.

Copy link
Owner Author

Asenar commented Mar 26, 2013

Remarques:

  1. normalement le "." dans le nom ça doit fonctionner pour le nom des branches, mais c'est à vérifier
  2. git add . j'ai un doute, à vérifier aussi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.