diff --git a/gitbootcamp.rst b/gitbootcamp.rst index 693ebade22..25d0b4f821 100644 --- a/gitbootcamp.rst +++ b/gitbootcamp.rst @@ -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 +To delete a **remote** branch:: + + $ git push origin -d + You may specify more than one branch for deletion. @@ -343,7 +350,4 @@ To edit an open pull request that targets ``master``: $ git push git@github.com:/cpython : -5. Optionally, delete the local PR branch:: - - $ git checkout master - $ git branch -D +5. Optionally, :ref:`delete the PR branch `. diff --git a/pullrequest.rst b/pullrequest.rst index 14cca68982..4a110d728c 100644 --- a/pullrequest.rst +++ b/pullrequest.rst @@ -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 ` + +#. Celebrate contributing to CPython! :) .. _Clear communication: https://opensource.guide/how-to-contribute/#how-to-submit-a-contribution .. _Open Source: https://opensource.guide/ @@ -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 `:: + + 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.