Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@JulienBreux
Forked from Asenar/gist:5246483
Created March 26, 2013 17:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JulienBreux/5247171 to your computer and use it in GitHub Desktop.
Save JulienBreux/5247171 to your computer and use it in GitHub Desktop.
smalte-migration_03-26-2013.sh
mkdir ~/tmp_working_dir
cd ~/tmp_working_dir
git init full_smalte
cd full_smalte
all_subs="installer framework module.sample tests theme.backoffice.default theme.frontoffice.default"
# 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/./-}_origin/develop
# 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 -A
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 https://github.com/Smalte/Smalte
#git push origin new_develop
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment