diff --git a/getting-started/git-boot-camp.rst b/getting-started/git-boot-camp.rst index 4d6aab073..f5854da56 100644 --- a/getting-started/git-boot-camp.rst +++ b/getting-started/git-boot-camp.rst @@ -47,17 +47,29 @@ You will only need to do this once. Cloning a Forked CPython Repository ----------------------------------- -You will only need to do this once. From your command line:: +You will only need to do this once per machine. From your command line:: git clone git@github.com:/cpython.git It is also recommended to configure an ``upstream`` remote repository:: cd cpython - git remote add upstream git@github.com:python/cpython.git + git remote add upstream https://github.com/python/cpython You can also use SSH-based or HTTPS-based URLs. +Configure the Remotes +--------------------- + +Configure ``git`` to pull ``main`` from the ``upstream`` remote:: + + git config --local branch.main.remote upstream + +Since one should never attempt to push to ``upstream``, configure +``git`` to push always to ``origin``:: + + git remote set-url --push upstream git@github.com:/cpython.git + Listing the Remote Repositories ------------------------------- @@ -70,8 +82,15 @@ and ``upstream`` pointing to the official CPython repository:: origin git@github.com:/cpython.git (fetch) origin git@github.com:/cpython.git (push) - upstream git@github.com:python/cpython.git (fetch) - upstream git@github.com:python/cpython.git (push) + upstream https://github.com/python/cpython (fetch) + upstream git@github.com:/cpython.git (push) + +To verify the upstream for ``main``:: + + git config branch.main.remote + +It should emit ``upstream``, indicating to track/pull changes for ``main`` from the +``upstream`` remote. .. _set-up-name-email: diff --git a/getting-started/setup-building.rst b/getting-started/setup-building.rst index 3a1b04c09..8d09ea988 100644 --- a/getting-started/setup-building.rst +++ b/getting-started/setup-building.rst @@ -60,7 +60,7 @@ The CPython repo is hosted on GitHub. To get a copy of the source code you shoul :ref:`fork the Python repository on GitHub `, :ref:`create a local clone of your personal fork, and configure the remotes `. -You will only need to execute these steps once: +You will only need to execute these steps once per machine: 1. Go to https://github.com/python/cpython. @@ -79,15 +79,26 @@ You will only need to execute these steps once: 6. Configure an ``upstream`` remote:: $ cd cpython - $ git remote add upstream git@github.com:python/cpython.git + $ git remote add upstream https://github.com/python/cpython -7. Verify that your setup is correct:: +7. Configure ``git`` to pull ``main`` from the ``upstream`` remote:: + + $ git config --local branch.main.remote upstream + +8. Since one should never attempt to push to ``upstream``, configure + ``git`` to push always to ``origin``:: + + $ git remote set-url --push upstream git@github.com:/cpython.git + +9. Verify that your setup is correct:: $ git remote -v origin git@github.com:/cpython.git (fetch) origin git@github.com:/cpython.git (push) - upstream git@github.com:python/cpython.git (fetch) - upstream git@github.com:python/cpython.git (push) + upstream https://github.com/python/cpython (fetch) + upstream git@github.com:/cpython.git (push) + $ git config branch.main.remote + upstream If you did everything correctly, you should now have a copy of the code in the ``cpython`` directory and two remotes that refer to your own GitHub fork