Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ our workflow that are not covered by a bot or status check are:
- All discussions that are not directly related to the code in the pull request
should happen on [bugs.python.org](https://bugs.python.org/)
- Upon your first non-trivial pull request (which includes documentation changes),
feel free to add yourself to [`Misc/ACKS`](https://github.com/python/cpython/blob/master/Misc/ACKS)
feel free to add yourself to [`Misc/ACKS`](https://github.com/python/cpython/blob/main/Misc/ACKS)


## Setting Expectations
Expand Down
2 changes: 1 addition & 1 deletion buildbots.rst
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ There are three ways of visualizing recent build results:
https://code.google.com/archive/p/bbreport. Installing it is trivial: just add
the directory containing ``bbreport.py`` to your system path so that
you can run it from any filesystem location. For example, if you want
to display the latest build results on the development ("master") branch,
to display the latest build results on the development ("main") branch,
type::

bbreport.py -q 3.x
Expand Down
12 changes: 6 additions & 6 deletions committing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ to enter the public source tree. Ask yourself the following questions:
we need to have a resolution there before we can merge the pull request.

* **Was the pull request first made against the appropriate branch?**
The only branch that receives new features is ``master``, the
The only branch that receives new features is ``main``, the
in-development branch. Pull requests should only target bug-fix branches
if an issue appears in only that version and possibly older versions.

Expand Down Expand Up @@ -165,15 +165,15 @@ Python repositories, so you need to be careful with your workflow:
You can also push these branches to a separate public repository
for maintenance work before it is integrated into the main repository.

* **You should not commit directly into the** ``master`` **branch, or any of the maintenance branches.**
* **You should not commit directly into the** ``main`` **branch, or any of the maintenance branches.**
You should commit against your own feature branch, and then create a
pull request.

* **For a small change, you can make a quick edit through the GitHub web UI.**
If you choose to use the web UI, be aware that GitHub will
create a new branch in the main CPython repository rather than in your fork.
Delete this newly created branch after it has been merged into the
``master`` branch or any of the maintenance branches. To keep the CPython
``main`` branch or any of the maintenance branches. To keep the CPython
repository tidy, remove the new branch within a few days.

Keep a fork of the main repository, since it will allow you to revert all
Expand All @@ -191,7 +191,7 @@ Seeing active branches

If you use ``git branch``, then you will see a :ref:`list of branches
<branchstatus>`. The only branch that receives new features is
``master``, the in-development branch. The other branches receive only
``main``, the in-development branch. The other branches receive only
bug fixes or security fixes.


Expand All @@ -211,15 +211,15 @@ backporting it themselves, using the backport generated by cherry_picker.py_
as a starting point.

You can get the commit hash from the original pull request, or you can use
``git log`` on the ``master`` branch. To display the 10 most recent commit
``git log`` on the ``main`` branch. To display the 10 most recent commit
hashes and their first line of the commit, use the following command::

git log -10 --oneline

.. _backport-pr-title:

You can prefix the backport pull request with the branch, and reference
the pull request number from ``master``. Here is an example::
the pull request number from ``main``. Here is an example::

[3.9] bpo-12345: Fix the Spam Module (GH-NNNN)

Expand Down
2 changes: 1 addition & 1 deletion coverity.rst
Original file line number Diff line number Diff line change
Expand Up @@ -150,4 +150,4 @@ Dakshesh Vyas <scan-admin@coverity.com>

.. _Coverity Connect: https://scan.coverity.com/projects/python

.. _coverity_model.c: https://github.com/python/cpython/blob/master/Misc/coverity_model.c
.. _coverity_model.c: https://github.com/python/cpython/blob/main/Misc/coverity_model.c
4 changes: 2 additions & 2 deletions devcycle.rst
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ There is a branch for each *feature version*, whether released or not (e.g.
In-development (main) branch
----------------------------

The ``master`` branch is the branch for the next feature release; it is
The ``main`` branch is the branch for the next feature release; it is
under active development for all kinds of changes: new features, semantic
changes, performance improvements, bug fixes.

Expand All @@ -57,7 +57,7 @@ release was cut (for example, 3.4.0 final).

Starting with the 3.5 release, we create the release maintenance branch
(e.g. 3.5) at the time we enter beta (3.5.0 beta 1). This allows
feature development for the release 3.n+1 to occur within the master
feature development for the release 3.n+1 to occur within the main
branch alongside the beta and release candidate stabilization periods
for release 3.n.

Expand Down
59 changes: 36 additions & 23 deletions gitbootcamp.rst
Original file line number Diff line number Diff line change
Expand Up @@ -103,17 +103,17 @@ Creating and Switching Branches
-------------------------------

.. important::
Never commit directly to the ``master`` branch.
Never commit directly to the ``main`` branch.

Create a new branch and switch to it::

# creates a new branch off master and switch to it
git checkout -b <branch-name> master
# creates a new branch off main and switch to it
git checkout -b <branch-name> main

This is equivalent to::

# create a new branch from master, without checking it out
git branch <branch-name> master
# create a new branch from main, without checking it out
git branch <branch-name> main
# check out the branch
git checkout <branch-name>

Expand Down Expand Up @@ -144,7 +144,7 @@ Deleting Branches

To delete a **local** branch that you no longer need::

git checkout master
git checkout main
git branch -D <branch-name>

To delete a **remote** branch::
Expand All @@ -153,6 +153,19 @@ To delete a **remote** branch::

You may specify more than one branch for deletion.


Renaming Branch
Copy link
Member Author

Choose a reason for hiding this comment

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

Added the instruction on how to rename local branch here.

---------------

The CPython repository's default branch was renamed from ``master`` to ``main``
after the Python 3.10b1 release. If you had cloned the repository before this
change, you can rename your local branch as follows::

git branch -m master main
git fetch upstream
git branch -u upstream/main main


Staging and Committing Files
----------------------------

Expand Down Expand Up @@ -230,7 +243,7 @@ Creating a Pull Request

3. Click the ``compare across forks`` link.

4. Select the base repository: ``python/cpython`` and base branch: ``master``.
4. Select the base repository: ``python/cpython`` and base branch: ``main``.

5. Select the head repository: ``<username>/cpython`` and head branch: the branch
containing your changes.
Expand All @@ -250,14 +263,14 @@ Scenario:
the upstream CPython repository.

Please do not try to solve this by creating a pull request from
``python:master`` to ``<username>:master`` as the authors of the patches will
``python:main`` to ``<username>:main`` as the authors of the patches will
get notified unnecessarily.

Solution::

git checkout master
git pull upstream master
git push origin master
git checkout main
git pull upstream main
git push origin main

.. note:: For the above commands to work, please follow the instructions found
in the :ref:`checkout` section
Expand All @@ -275,11 +288,11 @@ Solution::

git checkout some-branch
git fetch upstream
git merge upstream/master
git merge upstream/main
git push origin some-branch

You may see error messages like "CONFLICT" and "Automatic merge failed;" when
you run ``git merge upstream/master``.
you run ``git merge upstream/main``.

When it happens, you need to resolve conflict. See these articles about resolving conflicts:

Expand Down Expand Up @@ -308,7 +321,7 @@ Solution:

.. code-block:: bash

git checkout $(git rev-list -n 1 --before="yyyy-mm-dd hh:mm:ss" master)
git checkout $(git rev-list -n 1 --before="yyyy-mm-dd hh:mm:ss" main)
git apply /path/to/issueNNNN-git.patch

If the patch still won't apply, then a patch tool will not be able to
Expand All @@ -321,7 +334,7 @@ Solution:
5. If the patch was applied to an old revision, it needs to be updated and
merge conflicts need to be resolved::

git rebase master
git rebase main
git mergetool

6. Push the changes and open a pull request.
Expand Down Expand Up @@ -388,7 +401,7 @@ Pull requests can be accepted and merged by a Python Core Developer.
bpo-12345: Improve the spam module (#777)

* Improve the spam module
* merge from master
* merge from main
* adjust code based on review comment
* rebased

Expand All @@ -402,7 +415,7 @@ Backporting Merged Changes
--------------------------

A pull request may need to be backported into one of the maintenance branches
after it has been accepted and merged into ``master``. It is usually indicated
after it has been accepted and merged into ``main``. It is usually indicated
by the label ``needs backport to X.Y`` on the pull request itself.

Use the utility script
Expand All @@ -411,10 +424,10 @@ from the `core-workflow <https://github.com/python/core-workflow>`_
repository to backport the commit.

The commit hash for backporting is the squashed commit that was merged to
the ``master`` branch. On the merged pull request, scroll to the bottom of the
the ``main`` branch. On the merged pull request, scroll to the bottom of the
page. Find the event that says something like::

<core_developer> merged commit <commit_sha1> into python:master <sometime> ago.
<core_developer> merged commit <commit_sha1> into python:main <sometime> ago.

By following the link to ``<commit_sha1>``, you will get the full commit hash.

Expand Down Expand Up @@ -459,12 +472,12 @@ items like updating ``Misc/ACKS``.

.. _Allow edits from maintainers: https://help.github.com/articles/allowing-changes-to-a-pull-request-branch-created-from-a-fork/

To edit an open pull request that targets ``master``:
To edit an open pull request that targets ``main``:

1. In the pull request page, under the description, there is some information
about the contributor's forked CPython repository and branch name that will be useful later::

<contributor> wants to merge 1 commit into python:master from <contributor>:<branch_name>
<contributor> wants to merge 1 commit into python:main from <contributor>:<branch_name>

2. Fetch the pull request, using the :ref:`git pr <git_pr>` alias::

Expand All @@ -473,13 +486,13 @@ To edit an open pull request that targets ``master``:
This will checkout the contributor's branch at ``<pr_number>``.

3. Make and commit your changes on the branch. For example, merge in changes
made to ``master`` since the PR was submitted (any merge commits will be
made to ``main`` since the PR was submitted (any merge commits will be
removed by the later ``Squash and Merge`` when accepting the change):

.. code-block:: bash

git fetch upstream
git merge upstream/master
git merge upstream/main
git add <filename>
git commit -m "<message>"

Expand Down
10 changes: 5 additions & 5 deletions index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ instructions please see the :ref:`setup guide <setup>`.

5. Create a new branch where your work for the issue will go, e.g.::

git checkout -b fix-issue-12345 master
git checkout -b fix-issue-12345 main

If an issue does not already exist, please `create it
<https://bugs.python.org/>`_. Trivial issues (e.g. typo fixes) do not
Expand Down Expand Up @@ -98,7 +98,7 @@ Status of Python branches
+------------------+--------------+-------------+----------------+----------------+-----------------------+
| Branch | Schedule | Status | First release | End-of-life | Release manager |
+==================+==============+=============+================+================+=======================+
| master | :pep:`619` | features | *2021-10-04* | *TBD* | Pablo Galindo Salgado |
| main | :pep:`619` | features | *2021-10-04* | *TBD* | Pablo Galindo Salgado |
+------------------+--------------+-------------+----------------+----------------+-----------------------+
| 3.9 | :pep:`596` | bugfix | 2020-10-05 | *TBD* | Łukasz Langa |
+------------------+--------------+-------------+----------------+----------------+-----------------------+
Expand All @@ -111,7 +111,7 @@ Status of Python branches

.. Remember to update the end-of-life table in devcycle.rst.

The master branch is currently the future Python 3.10, and is the only
The main branch is currently the future Python 3.10, and is the only
branch that accepts new features. The latest release for each Python
version can be found on the `download page <https://www.python.org/downloads/>`_.

Expand Down Expand Up @@ -244,7 +244,7 @@ Key Resources
* `Buildbot status`_
* Source code
* `Browse online <https://github.com/python/cpython/>`_
* `Snapshot of the *master* branch <https://github.com/python/cpython/archive/master.zip>`_
* `Snapshot of the *main* branch <https://github.com/python/cpython/archive/main.zip>`_
* `Daily OS X installer <http://buildbot.python.org/daily-dmg/>`_
* PEPs_ (Python Enhancement Proposals)
* :doc:`help`
Expand Down Expand Up @@ -330,7 +330,7 @@ Full Table of Contents
appendix

.. _Buildbot status: https://www.python.org/dev/buildbot/
.. _Misc directory: https://github.com/python/cpython/tree/master/Misc
.. _Misc directory: https://github.com/python/cpython/tree/main/Misc
.. _PEPs: https://www.python.org/dev/peps/
.. _python.org maintenance: https://pythondotorg.readthedocs.io/
.. _Python: https://www.python.org/
Expand Down
8 changes: 4 additions & 4 deletions pullrequest.rst
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ You should have already :ref:`set up your system <setup>`,

* Create a new branch in your local clone::

git checkout -b <branch-name> upstream/master
git checkout -b <branch-name> upstream/main

* Make changes to the code, and use ``git status`` and ``git diff`` to see them.

Expand Down Expand Up @@ -122,12 +122,12 @@ You should have already :ref:`set up your system <setup>`,
there are merge conflicts, git will warn you about this and enter conflict
resolution mode. See :ref:`resolving-merge-conflicts` below.

* If time passes and there are merge conflicts with the master branch, GitHub
* If time passes and there are merge conflicts with the main branch, GitHub
will show a warning to this end and you may be asked to address this. Merge
the changes from the master branch while resolving the conflicts locally::
the changes from the main branch while resolving the conflicts locally::

git checkout <branch-name>
git pull upstream master # pull = fetch + merge
git pull upstream main # pull = fetch + merge
# resolve conflicts: see "Resolving Merge Conflicts" below
git push origin <branch-name>

Expand Down
2 changes: 1 addition & 1 deletion setup.rst
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ to build.

.. _this documentation: https://cpython-core-tutorial.readthedocs.io/en/latest/build_cpython_windows.html
.. _Visual Studio 2017: https://www.visualstudio.com/
.. _readme: https://github.com/python/cpython/blob/master/PCbuild/readme.txt
.. _readme: https://github.com/python/cpython/blob/main/PCbuild/readme.txt
.. _PCbuild directory: https://github.com/python/cpython/tree/2.7/PCbuild/
.. _2.7 readme: https://github.com/python/cpython/blob/2.7/PCbuild/readme.txt
.. _PC/VS9.0 directory: https://github.com/python/cpython/tree/2.7/PC/VS9.0/
Expand Down
Loading