Statistics
| Branch: | Revision:

iof-tools / networkxMiCe / networkx-master / doc / developer / gitwash / set_up_fork.rst @ 5cef0f13

History | View | Annotate | Download (2.04 KB)

1
.. highlight:: bash
2

    
3
.. _set-up-fork:
4

    
5
==================
6
 Set up your fork
7
==================
8

    
9
First you follow the instructions for :ref:`forking`.
10

    
11
Overview
12
========
13

    
14
::
15

    
16
   git clone git@github.com:your-user-name/networkx.git
17
   cd networkx
18
   git remote add upstream git://github.com/networkx/networkx.git
19

    
20
In detail
21
=========
22

    
23
Clone your fork
24
---------------
25

    
26
#. Clone your fork to the local computer with ``git clone
27
   git@github.com:your-user-name/networkx.git``
28
#. Investigate.  Change directory to your new repo: ``cd networkx``. Then
29
   ``git branch -a`` to show you all branches.  You'll get something
30
   like:
31

    
32
   .. code-block:: none
33

    
34
      * master
35
      remotes/origin/master
36

    
37
   This tells you that you are currently on the ``master`` branch, and
38
   that you also have a ``remote`` connection to ``origin/master``.
39
   What remote repository is ``remote/origin``? Try ``git remote -v`` to
40
   see the URLs for the remote.  They will point to your github fork.
41

    
42
   Now you want to connect to the upstream `networkx github`_ repository, so
43
   you can merge in changes from trunk.
44

    
45
.. _linking-to-upstream:
46

    
47
Linking your repository to the upstream repo
48
--------------------------------------------
49

    
50
::
51

    
52
   cd networkx
53
   git remote add upstream git://github.com/networkx/networkx.git
54

    
55
``upstream`` here is just the arbitrary name we're using to refer to the
56
main `networkx`_ repository at `networkx github`_.
57

    
58
Note that we've used ``git://`` for the URL rather than ``git@``.  The
59
``git://`` URL is read only.  This means we that we can't accidentally
60
(or deliberately) write to the upstream repo, and we are only going to
61
use it to merge into our own code.
62

    
63
Just for your own satisfaction, show yourself that you now have a new
64
'remote', with ``git remote -v show``, giving you something like:
65

    
66
.. code-block:: none
67

    
68
   upstream	git://github.com/networkx/networkx.git (fetch)
69
   upstream	git://github.com/networkx/networkx.git (push)
70
   origin	git@github.com:your-user-name/networkx.git (fetch)
71
   origin	git@github.com:your-user-name/networkx.git (push)
72

    
73
.. include:: links.inc