Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork870
Reorganize git commands#263
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Changes fromall commits
c5b768e
c507009
cafd72b
055d155
ae26a03
b4153d1
a3c6133
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -268,23 +268,6 @@ understands the justification for the change). Also, if a non-core developer | ||
contributed to the resolution, it is good practice to credit them. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. This has been moved after the section about backporting. | ||
Working with Git_ | ||
================= | ||
@@ -313,107 +296,6 @@ into a state you aren't happy with. | ||
.. _Git: https://git-scm.com/ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. All the stuff in this chunk either got added to the bootcamp or it was already there | ||
.. _committing-active-branches: | ||
Active branches | ||
@@ -454,34 +336,19 @@ Developers can apply labels to GitHub pull requests). | ||
.. _cherry_picker.py: https://github.com/python/core-workflow/tree/master/cherry_picker | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. This is already in the bootcamp (and somewhere else too). | ||
Reverting a Merged Pull Request | ||
------------------------------- | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. After asking around during the sprint, the consensus was to remove this section. | ||
To revert a merged pull request, press the ``Revert`` button at the bottom of | ||
the pull request. It will bring up the page to create a new pull request where | ||
the commit can be reverted. It also creates a new branch on the main CPython | ||
repository. Delete the branch once the pull request has been merged. | ||
Always include the reason for reverting the commit to help others understand | ||
why it was done. The reason should be included as part of the commit message, | ||
for example:: | ||
Revert bpo-NNNN: Fix Spam Module (GH-111) | ||
Reverts python/cpython#111. | ||
Reason: This commit broke the buildbot. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -10,6 +10,7 @@ relevant to CPython's workflow. | ||
.. contents:: | ||
.. _fork-cpython: | ||
Forking CPython GitHub Repository | ||
--------------------------------- | ||
@@ -24,24 +25,61 @@ You'll only need to do this once. | ||
4. Your fork will be created at https://github.com/<username>/cpython. | ||
.. _clone-your-fork: | ||
Cloning The Forked CPython Repository | ||
------------------------------------- | ||
You'll only need to do this once. From your command line:: | ||
$ git clone git@github.com:<username>/cpython.git | ||
It is also recommended to configure an ``upstream`` remote:: | ||
$ cd cpython | ||
$ git remote add upstream git@github.com:python/cpython.git | ||
You can also use SSH-based or HTTPS-based URLs. | ||
Listing the Remote Repositories | ||
------------------------------- | ||
To list the remote repositories that are configured, along with theirURLs:: | ||
$ git remote -v | ||
You should have two remotes: ``origin`` pointing to your fork, | ||
and ``upstream`` pointing to the official CPython repository:: | ||
origin git@github.com:<your-username>/devguide.git (fetch) | ||
origin git@github.com:<your-username>/devguide.git (push) | ||
upstream git@github.com:python/devguide.git (fetch) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. Since this doc will often be used by contributors that do not have push privileges for CPython, the upstream remote should point to Perhaps a note for committers that they should use what you have here for upstream. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. AFAICT, with this URL, they still should be able to fetch. If they try to push they will get an error because they don't have privileges, but that's OK since they are not supposed to push on upstream anyway. Unless I'm missing something, this URL should be fine for both contributors and core devs. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. Thanks@willingc and@ezio-melotti. I'm thinking it's fine to leave the | ||
upstream git@github.com:python/devguide.git (push) | ||
.. _set-up-name-email: | ||
Setting Up Your Name and Email Address | ||
-------------------------------------- | ||
:: | ||
$ git config --global user.name "Your Name" | ||
$ git config --global user.email email@example.org | ||
The ``--global`` flag sets these globally, | ||
``--local`` sets them only for the current project. | ||
.. _autocrlf: | ||
Enabling ``autocrlf`` on Windows | ||
-------------------------------- | ||
The *autocrlf* option will fix automatically any Windows-specific line endings. | ||
This should be enabled on Windows, since the public repository has a hook which | ||
will reject all changesets having the wrong line endings. | ||
:: | ||
$ git config --global core.autocrlf input | ||
Creating and Switching Branches | ||
------------------------------- | ||
@@ -139,6 +177,21 @@ To re-apply the last stashed change:: | ||
$ git stash pop | ||
.. _commit-changes: | ||
Committing Changes | ||
------------------ | ||
Add the files you want to commit:: | ||
$ git add <filename> | ||
Commit the files:: | ||
$ git commit -m '<message>' | ||
.. _push-changes: | ||
Pushing Changes | ||
--------------- | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -34,36 +34,27 @@ installation directions. You may also want to consider a graphical client | ||
such as `TortoiseGit <https://tortoisegit.org/>`_ or | ||
`GitHub Desktop <https://desktop.github.com/>`_. | ||
You may also wish to set up :ref:`your name and email <set-up-name-email>` | ||
and `an SSH key | ||
<https://help.github.com/articles/adding-a-new-ssh-key-to-your-github-account/>`_ | ||
as this will allow you to interact with GitHub without typing a username | ||
and password each time you execute a command, such as ``git pull``, | ||
``git push``, or ``git fetch``. On Windows, you should also | ||
:ref:`enable autocrlf <autocrlf>`. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. NIce! 👍 | ||
.. _checkout: | ||
Getting the Source Code | ||
----------------------- | ||
In order to get a copy of the source code you should first :ref:`fork the | ||
Python repository on GitHub <fork-cpython>` and then :ref:`create a local | ||
clone of your private fork and configure the remotes <clone-your-fork>`. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. "Personal" is probably the word I was looking for, but "your fork" is clear enough without additional qualifiers. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. I like personal 👍 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. I fixed this in#265 | ||
If you want a working copy of an already-released version of Python, | ||
i.e., a version in :ref:`maintenance mode <maintbranch>`, you can checkout | ||
a release branch. For instance, to checkout a working copy of Python 3.5, | ||
do ``git checkout 3.5``. | ||
You will need to re-compile CPython when you do such an update. | ||