Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9e3cc06

Browse files
committed
adding pullrequest guide for #103
1 parent 2afe3bd commit 9e3cc06

File tree

1 file changed

+83
-0
lines changed

1 file changed

+83
-0
lines changed

pullrequest.rst

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,89 @@ command (after any successful build of Python)::
9393
python.bat Tools/scripts/patchcheck.py
9494

9595

96+
Quick Guide
97+
'''''''''''
98+
99+
`Clear communication`_ is key to contributing to any project, especially an
100+
`Open Source`_ project like Python.
101+
102+
Here is a quick overview of you can contribute to CPython on Github:
103+
104+
1. `Create an Issue`_ that describes your change, if it doesn't exist and you're explicitly working on something
105+
106+
2. `Get started`_ and set up your system
107+
108+
3. Fork `CPython on Github`_ (using the Fork button in the upper-right on Github)
109+
110+
4. `Compile Python`_ on your system
111+
112+
5. `Run tests`_ after you have built Python
113+
114+
6. `Add an "upstream" Remote in Git`_ on your system
115+
116+
7. `Create a Branch in Git`_ where you can work on changes
117+
118+
8. Commit changes and `resolve conflicts in Git`_
119+
120+
9. `Run tests`_ again
121+
122+
10. `Push commits`_ to your Github repo
123+
124+
11. `Create Pull Request`_ in Github to merge a branch from your Fork
125+
126+
12. Celebrate! You just contributed to Python. :)
127+
128+
.. _Clear communication: https://opensource.guide/how-to-contribute/#how-to-submit-a-contribution
129+
.. _Open Source: https://opensource.guide/
130+
.. _Create an Issue: https://bugs.python.org/
131+
.. _Get started: https://cpython-devguide.readthedocs.io/setup.html#getting-started
132+
.. _CPython on Github: https://github.com/python/cpython
133+
.. _Compile Python: https://cpython-devguide.readthedocs.io/setup.html#compiling-for-debugging
134+
.. _Run tests: https://cpython-devguide.readthedocs.io/runtests.html#running-writing-tests
135+
.. _Add an "upstream" Remote in Git: https://cpython-devguide.readthedocs.io/committing.html#remotes-setup
136+
.. _Create a Branch in Git: https://cpython-devguide.readthedocs.io/committing.html#active-branches
137+
.. _resolve conflicts in Git: https://cpython-devguide.readthedocs.io/committing.html#squashing-commits
138+
.. _Run tests: https://cpython-devguide.readthedocs.io/runtests.html#running-writing-tests
139+
.. _Push commits: https://cpython-devguide.readthedocs.io/committing.html#pushing-changes
140+
.. _Create Pull Request: https://help.github.com/articles/creating-a-pull-request/
141+
142+
143+
Quick Guide Step-by-step
144+
''''''''''''''''''''''''
145+
146+
Set up your system::
147+
148+
git clone [email protected]:YOUR_GITHUB_ID/cpython.git
149+
150+
Replace **YOUR_GITHUB_ID** with your Github account name above, then add upstream::
151+
152+
git remote add upstream git://github.com/python/cpython.git
153+
154+
Work on new features or fixes::
155+
156+
git checkout -b MY_NEW_FEATURE upstream/master
157+
158+
As you work, please create a separate commit for each bug fix or feature change::
159+
160+
git commit
161+
162+
Then fetch upstream to see if anything conflicts with your changes::
163+
164+
git fetch upstream
165+
166+
Use rebase -i to verify what you commit and squish small commits::
167+
168+
git rebase -i upstream/master
169+
170+
Then push your work to your clone on Github::
171+
172+
git push origin MY_NEW_FEATURE
173+
174+
When you're ready, make a Pull Request on Github and refer to your branch named **MY_NEW_FEATURE**.
175+
176+
*Though submitting a Pull Request on Github is the preferred method of contribution, you can alternatively upload a patch to bugs.python.org*
177+
178+
96179
Licensing
97180
---------
98181

0 commit comments

Comments
 (0)