Skip to content

Instantly share code, notes, and snippets.

@opsb
Last active July 5, 2016 11:51
Show Gist options
  • Select an option

  • Save opsb/2fff11fc9ebbc0c1e0a58beb74a56d7f to your computer and use it in GitHub Desktop.

Select an option

Save opsb/2fff11fc9ebbc0c1e0a58beb74a56d7f to your computer and use it in GitHub Desktop.
Monorepo migration
cd myprojects/zapnito
git fetch origin
git checkout master
git reset --hard origin/master
mv .env* zapnito/
mv solr zapnito/
mv tmp zapnito/
mv log zapnito/
mv .sass-cache zapnito/
brew install gnu-sed
cd myprojects/zapnito-rails
git remote remove origin
git remote add origin git@github.com:zapnito/zapnito-rails
git fetch origin
git rebase origin/master
git push origin $feature_branch
cd myprojects/zapnito
git remote add zapnito-rails git@github.com:zapnito/zapnito-rails
git fetch zapnito-rails
git checkout -b $feature_branch zapnito-rails/$feature_branch
git filter-branch -f --index-filter \
'git ls-files -s | gsed "s/\t/\tzapnito\//" |
GIT_INDEX_FILE=$GIT_INDEX_FILE.new \
git update-index --index-info &&
mv "$GIT_INDEX_FILE.new" "$GIT_INDEX_FILE"' HEAD
git rebase origin/master
brew install gnu-sed
cd myprojects/zapnito-web
git fetch origin
git rebase origin/master
git push origin $feature_branch
cd myprojects/zapnito
git remote add zapnito-web git@github.com:zapnito/zapnito-web
git fetch zapnito-web
git checkout -b $feature_branch zapnito-web/$feature_branch
git filter-branch -f --index-filter \
'git ls-files -s | gsed "s/\t/\tzapnito-web\//" |
GIT_INDEX_FILE=$GIT_INDEX_FILE.new \
git update-index --index-info &&
mv "$GIT_INDEX_FILE.new" "$GIT_INDEX_FILE"' HEAD
git rebase origin/master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment