git example page
Once you have forked pybrain/pybrain via the github web interface, you can clone it locally:
git clone git@github.com:<your-username>/pybrain.git
After you have done some changes locally to your code, you can push them back to your github fork:
$ git commit -a -m "Awesome change implemented!" $ git push
Remotes are bookmarks to clones/forks/repositories in different directories (possibly on different computers). This are always identified by an URL, which might be a webadress, a ssh adress or a local file system path. E.g. you can add the central PyBrain as a remote:
$ git remote add central git://github.com/pybrain/pybrain.git
After that, you can fetch changes from the central repository and merge them into your local clone. (This examples assumes that you want changes from the master branch.)
$ git fetch central $ git merge central/master
To do both commands in one swipe, you can also do:
$ git pull central master
Make sure you have added the pybrain/pybrain repositry as the remote central
. This command gives you a list of the differing changesets between the central master branch and your master branch.
$ git fetch central $ git cherry -v central/master master
If you want diff outputs, you can do:
$ git fetch central $ git diff central/master master
There is three easy ways:
- Either of you gives the other one an ssh account with read/write access to his repository
- Either of you exposes the repository directory over the network
- Either of you starts a web server (lighttpd installation required)
In case of the first method, you will come up with an url similar to the following:
ssh://<username>@<computername>/path/to/repos
In the second case, it will just be a normal file system path. In the last case, you can use
$ git instaweb --start
which starts a webserver at
http://<some-up-adress>:1234/
All these urls can be used to add another remote to github. Say Alice and Bob want to cooperate working on a branch cake
. Alice then can add Bob as a remote via
$ git remote add bob <the-url-from-previous-section>
In order to merge in Bob’s changes, she can always do
$ git pull bob cake
and git will fetch and merge in any changes Bob has committed on his side.
Make sure you have added the pybrain/pybrain repository as the remote central
as explained above. Then pull all changes from the central repository to get up-to-date:
$ git pull central
Generate a set of patch files containing all the changesets in some directory by using:
$ git format-patch -o <some-directory> central/master
you can then either zip those files up and send them to someone (e.g. coredev@python.org :) or use git for this (if you have sendmail configured correctly):
$ git send-email --from <your-email> --to coredev@pybrain.org <some-directory-as-above>