Following the latest source¶
These are the instructions if you just want to follow the latest networkx source, but you don’t need to do any development for now.
The steps are:
- Install git
- get local copy of the networkx github git repository
- update local copy from time to time
Get the local copy of the code¶
From the command line:
git clone git://github.com/networkx/networkx.git
You now have a copy of the code tree in the new networkx
directory.
Updating the code¶
From time to time you may want to pull down the latest code. It is necessary to add the networkx repository as a remote to your configuration file. We call it upstream.
git remote set-url upstream https://github.com/networkx/networkx.git
Now git knows where to fetch updates from.
cd networkx git fetch upstream
The tree in networkx
will now have the latest changes from the initial
repository, unless you have made local changes in the meantime. In this case, you have to merge.
git merge upstream/master
It is also possible to update your local fork directly from GitHub:
- Open your fork on GitHub.
- Click on ‘Pull Requests’.
- Click on ‘New Pull Request’. By default, GitHub will compare the original with your fork. If you didn’t make any changes, there is nothing to compare.
- Click on ‘Switching the base’ or click ‘Edit’ and switch the base manually. Now GitHub will compare your fork with the original, and you should see all the latest changes.
- Click on ‘Click to create a pull request for this comparison’ and name your pull request.
- Click on Send pull request.
- Scroll down and click ‘Merge pull request’ and finally ‘Confirm merge’. You will be able to merge it automatically unless you did not change you local repo.