Created
March 9, 2020 17:37
-
-
Save ajtucker/e72e937394add1597744f8740bae00ac to your computer and use it in GitHub Desktop.
Join trade repos into one family repo
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| shopt -s extglob | |
| shopt -s dotglob | |
| repos="HMRC-RTS-Small-area HMRC_RTS HMRC_OTS_CN8 HMRC_Trade ONS-FDI-inward-and-outward ONS-International-Trade-in-Services ONS-REUK-Service ONS-Trade-in-goods ONS-UK-SA-Trade-in-goods ONS-UK-Total-trade ONS-UK-trade-in-goods-by-industry-country-and-commodity ONS-UK-trade-in-services ONS_ABS ONS_BoP ONS_BoP_individual-country-data ONS_CPA" | |
| #repos="ONS_PinkBook ONS_MRETS" | |
| [email protected]:GSS-Cogs | |
| rm -rf family-trade | |
| mkdir family-trade | |
| cd family-trade | |
| git init . | |
| git lfs install | |
| for repo in $repos; do | |
| git remote add $repo $REPO_DIR/$repo | |
| git fetch $repo --tags | |
| git merge --no-edit --allow-unrelated-histories $repo/master | |
| mkdir -p datasets/$repo | |
| git remote remove $repo | |
| git mv !(datasets|.|..|.git) datasets/$repo/ | |
| git commit -m "Moved to new layout" | |
| done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment