File tree Expand file tree Collapse file tree 2 files changed +19
-8
lines changed
Expand file tree Collapse file tree 2 files changed +19
-8
lines changed Original file line number Diff line number Diff line change @@ -82,13 +82,20 @@ on the 2.7 release::
8282 $ git checkout -b 2.7 origin/2.7
8383
8484
85- Deleting Local Branches
86- -----------------------
85+ .. _deleting_branches :
86+
87+ Deleting Branches
88+ -----------------
8789
88- To delete a branch that you no longer need::
90+ To delete a ** local ** branch that you no longer need::
8991
92+ $ git checkout master
9093 $ git branch -D <branch-name>
9194
95+ To delete a **remote ** branch::
96+
97+ $ git push origin -d <branch-name>
98+
9299You may specify more than one branch for deletion.
93100
94101
@@ -343,7 +350,4 @@ To edit an open pull request that targets ``master``:
343350
344351 $ git push [email protected] :<contributor>/cpython <pr_XXX>:<branch_name> 345352
346- 5. Optionally, delete the local PR branch::
347-
348- $ git checkout master
349- $ git branch -D <pr_XXX>
353+ 5. Optionally, :ref: `delete the PR branch <deleting_branches >`.
Original file line number Diff line number Diff line change @@ -127,7 +127,9 @@ Here is a quick overview of how you can contribute to CPython on GitHub:
127127
128128#. Review and address `comments on your Pull Request `_
129129
130- #. When your changes are merged, celebrate contributing to CPython! :)
130+ #. When your changes are merged, you can :ref: `delete the PR branch <deleting_branches >`
131+
132+ #. Celebrate contributing to CPython! :)
131133
132134.. _Clear communication : https://opensource.guide/how-to-contribute/#how-to-submit-a-contribution
133135.. _Open Source : https://opensource.guide/
@@ -170,6 +172,11 @@ Then push your work to your clone on GitHub::
170172
171173Make a pull request on GitHub from your changes in ``MY_BRANCH_NAME ``.
172174
175+ After your PR has been accepted and merged, you can :ref: `delete the branch <deleting_branches >`::
176+
177+ git branch -D MY_BRANCH_NAME # delete local branch
178+ git push origin -d MY_BRANCH_NAME # delete remote branch
179+
173180.. note ::
174181 You can still upload a patch to bugs.python.org _, but the GitHub pull request
175182 workflow is **strongly ** preferred.
You can’t perform that action at this time.
0 commit comments