Skip to content

Instantly share code, notes, and snippets.

@mshuler
Created November 23, 2010 01:33
Show Gist options
  • Save mshuler/711084 to your computer and use it in GitHub Desktop.
Save mshuler/711084 to your computer and use it in GitHub Desktop.
example github mirror from launchpad
#!/bin/sh
# OpenStack bzr to github mirror
#
# Requirements:
# git >= 1.7.0, bzr >= 2.0.0,
# git-bzr-ng, python-fastimport, patched bzr-fastimport
#####
# Set up unpackaged source:
# mkdir ~/src
# cd ~/src/
# git clone git://github.com/termie/git-bzr-ng.git
# bzr branch lp:python-fastimport
# mkdir ~/bin
# cd ~/bin/
# ln -s ~/src/git-bzr-ng/git-bzr
#
# Patch bzr-fastimport:
# mkdir -p ~/.bazaar/plugins
# cd ~/.bazaar/plugins/
# bzr branch lp:bzr-fastimport fastimport
# one line patch to fix multi-author bzr commit export:
#
#=== modified file 'exporter.py'
#--- exporter.py 2010-11-09 18:26:43 +0000
#+++ exporter.py 2010-11-22 15:34:34 +0000
#@@ -287,7 +287,7 @@
# else:
# more_authors = []
# author = revobj.get_apparent_author()
#- if more_authors:
#+ if not self.plain_format and more_authors:
# name, email = self._get_name_email(author)
# author_info = (name, email, revobj.timestamp, revobj.timezone)
# more_author_info = []
#####
# Set up local swift and nova repos:
# mkdir ~/git-bzr
# cd ~/git-bzr/
# git bzr clone lp:nova nova
# git bzr clone lp:swift swift
# cd ~/git-bzr/nova/
# git remote add github git@github.com:openstack/nova.git
# cd ~/git-bzr/swift/
# git remote add github git@github.com:openstack/swift.git
export PATH="$HOME/bin:$PATH"
export PYTHONPATH=$HOME/src/python-fastimport
REPOBASE=$HOME/git-bzr
for REPO in nova swift; do
cd $REPOBASE/$REPO/
echo "Syncing $REPO repository from launchpad.."
git bzr sync
echo "Merging $REPO bzr/master.."
git merge bzr/master
echo "Pushing $REPO repository to github.."
git push github master
cd $HOME
done
@khurshid-alam
Copy link

I am getting a error while using git push. This looks like

remote: error: object 3ed75d4bbxxxxxxxxxxxxxxxx7cc:contains '.git'
remote: fatal: Error in object
error: unpack failed: index-pack abnormal exit

Any idea why?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment