Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Move the remote configuration instructions.
  • Loading branch information
ezio-melotti committed Sep 7, 2017
commit c507009b1d4f56b46915f4e1a6f626573d1d4f01
35 changes: 0 additions & 35 deletions committing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -318,41 +318,6 @@ Remotes Setup
-------------


.. _remote-configuration:

Configuration
'''''''''''''

There are several possible ways how to set up your git repository. This section
discusses the simplest approach of having a single directory with two remotes,
one pointing to private fork, the other one being the official repository.

Assuming you have :ref:`cloned the official repository <checkout>` here is how
your current setup should look like::

$ git remote -v # show remotes
origin https://github.com/python/cpython (fetch)
origin https://github.com/python/cpython (push)

You can have multiple remotes defined for a single repository, the usual approach
is to have ``origin`` pointing to your :ref:`private fork <forking>`, and ``upstream``
pointing to the official repository. To do so, here are the steps needed to have
that setup::

git remote set-url origin https://github.com/<your-username>/cpython
git remote add upstream https://github.com/python/cpython

After that, your remotes configuration should look like this::

$ git remote -v # show remotes
origin https://github.com/<your-username>/cpython (fetch)
origin https://github.com/<your-username>/cpython (push)
upstream https://github.com/python/cpython (fetch)
upstream https://github.com/python/cpython (push)

At any point in time you can use SSH-based URL instead of HTTPS-based ones.


.. _committing-push-changes:

Pushing changes
Expand Down
17 changes: 16 additions & 1 deletion gitbootcamp.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ relevant to CPython's workflow.

.. contents::

.. _fork-cpython:

Forking CPython GitHub Repository
---------------------------------
Expand All @@ -24,24 +25,38 @@ You'll only need to do this once.

4. Your fork will be created at https://github.com/<username>/cpython.

.. _clone-your-fork:

Cloning The Forked CPython Repository
-------------------------------------

You'll only need to do this once. From your command line::

$ git clone git@github.com:<username>/cpython.git

It is also recommended to configure an `upstream` remote::

$ cd cpython
$ git remote add upstream git@github.com:python/cpython.git

You can also use SSH-based or HTTPS-based URLs.

Listing the Remote Repositories
-------------------------------

To list the remote repositories that are configured, along with their urls::
To list the remote repositories that are configured, along with their URLs::

$ git remote -v

You should have two remotes: ``origin`` pointing to your fork,
and ``upstream`` pointing to the official CPython repository::

origin git@github.com:<your-username>/devguide.git (fetch)
origin git@github.com:<your-username>/devguide.git (push)
upstream git@github.com:python/devguide.git (fetch)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this doc will often be used by contributors that do not have push privileges for CPython, the upstream remote should point to https://github.com/python/cpython in the doc here.

Perhaps a note for committers that they should use what you have here for upstream.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AFAICT, with this URL, they still should be able to fetch. If they try to push they will get an error because they don't have privileges, but that's OK since they are not supposed to push on upstream anyway. Unless I'm missing something, this URL should be fine for both contributors and core devs.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @willingc and @ezio-melotti. I'm thinking it's fine to leave the upstream using SSH url.
For contributors, they would have to configure SSH key anyway.

upstream git@github.com:python/devguide.git (push)


.. _set-up-name-email:

Setting Up Your Name and Email Address
Expand Down
20 changes: 5 additions & 15 deletions setup.rst
Original file line number Diff line number Diff line change
Expand Up @@ -46,24 +46,14 @@ and password each time you execute a command, such as ``git pull``,
Getting the Source Code
-----------------------

One should always work from a working copy of the CPython source code.
While it may
be tempting to work from the copy of Python you already have installed on your
machine, it is very likely that you will be working from out-of-date code as
the Python core developers are constantly updating and fixing things in their
:abbr:`VCS (version control system)`. It also means you will have better tool
support through the VCS as it will provide a diff tool, etc.

To get a working copy of the :ref:`in-development <indevbranch>` branch of
CPython, run::

git clone https://github.com/python/cpython
In order to get a copy of the source code you should first :ref:`fork the
Python repository on GitHub <fork-cpython>` and then :ref:`create a local
clone of your private fork and configure the remotes <clone-your-fork>`.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

private I know what you are trying to say here but the fork is public. I think it is better to use ...clone of your fork and configure...

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Personal" is probably the word I was looking for, but "your fork" is clear enough without additional qualifiers.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like personal 👍

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I fixed this in #265


If you want a working copy of an already-released version of Python,
i.e., a version in :ref:`maintenance mode <maintbranch>`, you can checkout
a release branch. For instance, to checkout a working copy of Python 3.5, do::

git checkout 3.5
a release branch. For instance, to checkout a working copy of Python 3.5,
do ``git checkout 3.5``.

You will need to re-compile CPython when you do such an update.

Expand Down