Created
November 28, 2012 05:30
-
-
Save petterl/4159212 to your computer and use it in GitHub Desktop.
Sync of repo from bzr (lauchpad) to git (github) (manually since some commits where bad according to github)
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
# Create repo | |
mkdir eventum | |
cd eventum | |
git init | |
# Prepare for bzr | |
mkdir .git/bzr | |
mkdir .git/bzr/repo | |
mkdir .git/bzr/map | |
bzr init-repo --no-trees .git/bzr/repo | |
bzr branch lp:eventum .git/bzr/repo/master | |
# Fast-export the bzr repo | |
bzr fast-export --plain --export-marks=.git/bzr/map/master-bzr --git-branch=bzr/master .git/bzr/repo/master > bzr-fast-export | |
# Fixing the repo committers | |
sed "s/^committer <Elan>/committer Elan Ruusamäe <[email protected]>/" bzr-fast-export > bzr-fast-export-fix | |
sed "s/^committer <>/committer Unknown <[email protected]>/" bzr-fast-export-fix > bzr-fast-export | |
rm bzr-fast-export-fix | |
# Import into git | |
git fast-import --quiet --export-marks=.git/bzr/map/master-git < bzr-fast-export | |
rm bzr-fast-export | |
git branch master bzr/master | |
git config bzr.master.bzr bzr/master | |
git config bzr.bzr/master.upstream lp:eventum | |
git checkout master | |
git bzr sync | |
git remote add github [email protected]:petterl/eventum.git | |
git push github master |
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
REPOBASE=$HOME/repos | |
for REPO in eventum; do | |
cd $REPOBASE/$REPO/ | |
echo "Syncing $REPO repository from launchpad.." | |
git bzr pull | |
echo "Pushing $REPO repository to github.." | |
git push github master | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment