Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Update bootcamp FAQ about "Checking out others' PRs" #1694

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
ezio-melotti wants to merge 4 commits into python:main
base: main
Choose a base branch
Loading
from ezio-melotti:update-alias
Open
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
13 changes: 10 additions & 3 deletions getting-started/git-boot-camp.rst
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -453,19 +453,26 @@ Both of these tools will configure a remote URL for the branch, so you can
``git push`` if the pull request author checked "Allow edits from maintainers"
when creating the pull request.

If you don't have GitHub CLI or hub installed, you can set up a git alias:
Otherwise, you can run the following commands:

.. code-block:: shell

$ git fetch upstream pull/NNNNN/head:pr_NNNNN
$ git switch pr_NNNNN

Or set up a Git alias:

.. tab:: Unix/macOS

.. code-block:: shell

$ git config --global alias.pr '!sh -c "git fetch upstream pull/${1}/head:pr_${1} && git checkout pr_${1}" -'
$ git config --global alias.pr '!sh -c "git fetch upstream pull/${1}/head:pr_${1} && git switch pr_${1}" -'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
$ git config --global alias.pr '!sh -c "git fetch upstream pull/${1}/head:pr_${1} && git switch pr_${1}" -'
git config --global alias.pr '!sh -c "git fetch upstream pull/${1}/head:pr_${1} && git switch pr_${1}" -'

Copy link
Member Author

@ezio-melotti ezio-melotti Nov 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Most command in the page have the $, even though I don't remember if there was a specific reason/convention, so I didn't remove it. We could remove most/all of them in a separate PR.

https://devguide.python.org/documentation/style-guide/#code-examples says to use prompts sparingly to differentiate input/output lines, even though it's talking mainly about Python >>>/.... We could remove most/all of them in a separate PR.

Also note that the shell highlight is for shell scripts, whereas the console highlight for shell sessions with prompts (see https://pygments.org/docs/lexers/#lexers-for-various-shells).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, console is useful when you have a prompt and output to show. Otherwise shell for plain commands.

Console:

$ ls | wc -l # good formatting for command + output 👍 
 158
ls | wc -l # bad formatting for command 👎 

Shell:

$ ls | wc -l # bad formatting for output 👎 
 158
ls | wc -l # good formatting for command 👍 

ezio-melotti reacted with thumbs up emoji

.. tab:: Windows

.. code-block:: dosbatch

git config --global alias.pr "!sh -c 'git fetch upstream pull/${1}/head:pr_${1} && git checkout pr_${1}' -"
git config --global alias.pr "!sh -c 'git fetch upstream pull/${1}/head:pr_${1} && git switch pr_${1}' -"

The alias only needs to be done once. After the alias is set up, you can get a
local copy of a pull request as follows::
Expand Down
Loading

AltStyle によって変換されたページ (->オリジナル) /