Skip to content

Commit

Permalink
DOC better clarify upstream synchronization in contributing guide (#1…
Browse files Browse the repository at this point in the history
…3505)

* clarify upstream synchronization

* apply Nicolas's comment

* fix typo

* don't mention the rebase

* move the notes

* fix branch name
  • Loading branch information
adrinjalali committed Mar 26, 2019
1 parent 4eb85b4 commit ab399a6
Showing 1 changed file with 20 additions and 13 deletions.
33 changes: 20 additions & 13 deletions doc/developers/contributing.rst
Expand Up @@ -213,6 +213,22 @@ then submit a "pull request" (PR):
and start making changes. Always use a ``feature`` branch. It's good practice to
never work on the ``master`` branch!

.. note::

In the above setup, your ``origin`` remote repository points to
``YourLogin/scikit-learn.git``. If you wish to fetch/merge from the main
repository instead of your forked one, you will need to add another remote
to use instead of ``origin``. If we choose the name ``upstream`` for it, the
command will be::

$ git remote add upstream https://github.com/scikit-learn/scikit-learn.git

And in order to fetch the new remote and base your work on the latest changes
of it you can::

$ git fetch upstream
$ git checkout -b my-feature upstream/master

6. Develop the feature on your feature branch on your computer, using Git to do the
version control. When you're done editing, add changed files using ``git add``
and then ``git commit`` files::
Expand All @@ -235,27 +251,18 @@ then submit a "pull request" (PR):
If you are modifying a Cython module, you have to re-run step 4 after modifications
and before testing them.

.. note::

In the above setup, your ``origin`` remote repository points to
YourLogin/scikit-learn.git. If you wish to fetch/merge from the main
repository instead of your forked one, you will need to add another remote
to use instead of ``origin``. If we choose the name ``upstream`` for it, the
command will be::

$ git remote add upstream https://github.com/scikit-learn/scikit-learn.git

If any of the above seems like magic to you, then look up the `Git documentation
<https://git-scm.com/documentation>`_ and the `Git development workflow
<http://docs.scipy.org/doc/numpy/dev/gitwash/development_workflow.html>`_ on the
web, or ask a friend or another contributor for help.

If some conflicts arise between your branch and the ``master`` branch, you need
to merge ``master``. The command will be::

$ git merge master
to merge ``master``. For that, you first need to fetch the ``upstream``, and
then merge its ``master`` into your branch::

with ``master`` being synchronized with the ``upstream``.
$ git fetch upstream
$ git merge upstream/master

Subsequently, you need to solve the conflicts. You can refer to the `Git
documentation related to resolving merge conflict using the command line
Expand Down

0 comments on commit ab399a6

Please sign in to comment.