This section and the next describe in detail how to set up git for workingwith the NumPy source code. If you have git already set up, skip toDevelopment workflow.
Introduce yourself to Git:
gitconfig--globaluser.emailyou@yourdomain.example.comgitconfig--globaluser.name"Your Name Comes Here"
You need to do this only once. The instructions here are very similarto the instructions athttp://help.github.com/forking/ - please see thatpage for more detail. We’re repeating some of it here just to give thespecifics for theNumPy project, and to suggest some default names.
If you don’t have agithub account, go to thegithub page, and make one.
You then need to configure your account to allow write access - see theGeneratingSSHkeys help ongithub help.
First you follow the instructions forMaking your own copy (fork) of NumPy.
gitclonehttps://github.com/your-user-name/numpy.gitcdnumpygitremoteaddupstreamhttps://github.com/numpy/numpy.git
Clone your fork to the local computer withgitclonehttps://github.com/your-user-name/numpy.git
Investigate. Change directory to your new repo:cdnumpy. Thengitbranch-a to show you all branches. You’ll get somethinglike:
*masterremotes/origin/master
This tells you that you are currently on themaster branch, andthat you also have aremote connection toorigin/master.What remote repository isremote/origin? Trygitremote-v tosee the URLs for the remote. They will point to yourgithub fork.
Now you want to connect to the upstreamNumPy github repository, soyou can merge in changes from trunk.
cdnumpygitremoteaddupstreamhttps://github.com/numpy/numpy.git
upstream here is just the arbitrary name we’re using to refer to themainNumPy repository atNumPy github.
Just for your own satisfaction, show yourself that you now have a new‘remote’, withgitremote-vshow, giving you something like:
upstreamhttps://github.com/numpy/numpy.git(fetch)upstreamhttps://github.com/numpy/numpy.git(push)originhttps://github.com/your-user-name/numpy.git(fetch)originhttps://github.com/your-user-name/numpy.git(push)
To keep in sync with changes in NumPy, you want to set up your repositoryso it pulls fromupstream by default. This can be done with:
gitconfigbranch.master.remoteupstreamgitconfigbranch.master.mergerefs/heads/master
You may also want to have easy access to all pull requests sent to theNumPy repository:
gitconfig--addremote.upstream.fetch'+refs/pull/*/head:refs/remotes/upstream/pr/*'
Your config file should now look something like (from$cat.git/config):
[core]repositoryformatversion=0filemode=truebare=falselogallrefupdates=trueignorecase=trueprecomposeunicode=false[remote"origin"]url=https://github.com/your-user-name/numpy.gitfetch=+refs/heads/*:refs/remotes/origin/*[remote"upstream"]url=https://github.com/numpy/numpy.gitfetch=+refs/heads/*:refs/remotes/upstream/*fetch=+refs/pull/*/head:refs/remotes/upstream/pr/*[branch"master"]remote=upstreammerge=refs/heads/master