Version 6 (modified by pv, 4 years ago)

More git mirrors on github

There are automatically updated git mirrors of Numpy (and Scipy) on github:

One can also be found here:

I won't talk about how to use git, only some points to keep in mind when using the mirror. There is a lot of resources to learn git on the web.

Download the git

Cloning the repository is straightforward:

git clone git://github.com/cournape/numpy.git

Importing svn meta-data

Unfortunately, the clone command of git does not copy the svn metadata. To do so, you have to do the following for each clone:

Add the numpy svn-remote

Edit your .git/config, and add the follwing:

[svn-remote "svn"]
        url = http://svn.scipy.org/svn/numpy
        fetch = trunk:refs/remotes/trunk
        branches = branches/*:refs/remotes/*
        tags = tags/*:refs/remotes/tags/*

This tells git-svn where to get svn meta-data

Get the svn metadata

Execute the following command:

git fetch git://github.com/cournape/numpy.git +refs/remotes/*:refs/remotes/*

This will tell git to download all the svn branch/tags info available on the git mirror

Update the svn metadata

To update the svn metadata of say the trunk:

git checkout master && git svn rebase -l

It may take some time the first time.

Using the git import

Create a branch

There is one rule to always remember: NEVER WORK ON A SVN BRANCH DIRECTLY, ALWAYS ON A BRANCH MADE FROM IT ! Concretely, if you want to work on the trunk

# Make sure you are on the trunk
git checkout trunk 
# Make a branch work from trunk
git branch work
# Go into the branch
git checkout work

Committing to svn

You can commit back to the scipy svn repository with git svn dcommit:

git svn dcommit

Before actually committing, it is a good idea to check whether you are committing where you think you are committing (with the dry run option of git svn dcommit):

git svn dcommit -n

Updating from numpy svn repository

Use the rebase command. For example, updating the trunk is a matter of:

git checkout trunk
git svn rebase -l