Last active
January 24, 2016 17:53
-
-
Save andrey-utkin/c7c6500bd83f4be4e634 to your computer and use it in GitHub Desktop.
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
#!/bin/bash | |
set -e | |
ORIGIN_URI='git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git' | |
LOCATION="${1:-`pwd`/linux-stable-mirror.git}" | |
if ! [[ -e "$LOCATION" ]] | |
then | |
git clone --bare "$ORIGIN_URI" "$LOCATION" | |
cd "$LOCATION" | |
git remote add github 'git@github.com:linux-stable/linux-stable.git' | |
git remote add gitlab 'git@gitlab.com:linux-stable/linux-stable.git' | |
git remote add bitbucket 'git@bitbucket.org:linux-stable/linux-stable.git' | |
else | |
cd "$LOCATION" | |
fi | |
git fetch --prune origin "+*:*" | |
git fetch --prune --tags origin "+*:*" | |
for x in `git remote | grep -v origin` | |
do | |
git push --force --prune $x +: | |
git push --force --prune --tags $x +: | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment