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
18 changes: 11 additions & 7 deletions gitbootcamp.rst
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,20 @@ on the 2.7 release::
$ git checkout -b 2.7 origin/2.7


Deleting Local Branches
-----------------------
.. _deleting_branches:

Deleting Branches
-----------------

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

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

To delete a **remote** branch::

$ git push origin -d <branch-name>

You may specify more than one branch for deletion.


Expand Down Expand Up @@ -343,7 +350,4 @@ To edit an open pull request that targets ``master``:

$ git push git@github.com:<contributor>/cpython <pr_XXX>:<branch_name>

5. Optionally, delete the local PR branch::

$ git checkout master
$ git branch -D <pr_XXX>
5. Optionally, :ref:`delete the PR branch <deleting_branches>`.
9 changes: 8 additions & 1 deletion pullrequest.rst
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,9 @@ Here is a quick overview of how you can contribute to CPython on GitHub:

#. Review and address `comments on your Pull Request`_

#. When your changes are merged, celebrate contributing to CPython! :)
#. When your changes are merged, you can :ref:`delete the PR branch <deleting_branches>`

#. Celebrate contributing to CPython! :)

.. _Clear communication: https://opensource.guide/how-to-contribute/#how-to-submit-a-contribution
.. _Open Source: https://opensource.guide/
Expand Down Expand Up @@ -170,6 +172,11 @@ Then push your work to your clone on GitHub::

Make a pull request on GitHub from your changes in ``MY_BRANCH_NAME``.

After your PR has been accepted and merged, you can :ref:`delete the branch <deleting_branches>`::

git branch -D MY_BRANCH_NAME # delete local branch
git push origin -d MY_BRANCH_NAME # delete remote branch

.. note::
You can still upload a patch to bugs.python.org_, but the GitHub pull request
workflow is **strongly** preferred.
Expand Down