Created
May 27, 2015 14:05
-
-
Save veritech/852b5cd089cf4f46503b to your computer and use it in GitHub Desktop.
Mirror a repo, Update a remote copy, while stripping history
This file contains 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 | |
SOURCE_REPO="" #ie. [email protected]:veritech/FRCoreDataOperation.git | |
DESTINATION_REPO="" #[email protected]:veritech/mirror.git | |
FORMATTED_DATE=`date +"%B %d %Y"` | |
# Get the head of the mirror repo | |
git clone $DESTINATION_REPO mirror | |
# Get the head of the of the source repo | |
git clone --depth 1 $SOURCE_REPO original | |
# Copy the contents over | |
rsync -avr --progress original/ mirror --exclude .git | |
# Go the mirror | |
cd mirror | |
# Add all the files | |
git add -A | |
# | |
git commit -m "$FORMATTED_DATE release" | |
git push origin master | |
cd .. | |
rm -rf orginal | |
rm -rf mirror |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment