Skip to content

Commit a5e6aad

Browse files
ezio-melottihugovkwillingc
authored
Update bootcamp FAQ about "Checking out others' PRs" (#1694)
* Update Git alias command for pulling PR branches * Remove extra whitespace * Capitalize `Or` at the beginning of the sentence Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> * Rephrase sentence * Apply suggestion from @hugovk Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> --------- Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
1 parent ce80d85 commit a5e6aad

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

getting-started/git-boot-camp.rst

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -447,19 +447,26 @@ Both of these tools will configure a remote URL for the branch, so you can
447447
``git push`` if the pull request author checked "Allow edits from maintainers"
448448
when creating the pull request.
449449

450-
If you don't have GitHub CLI or hub installed, you can set up a git alias:
450+
Otherwise, you can run the following commands:
451+
452+
.. code-block:: shell
453+
454+
$ git fetch upstream pull/NNNNN/head:pr_NNNNN
455+
$ git switch pr_NNNNN
456+
457+
Or set up a Git alias:
451458

452459
.. tab:: Unix/macOS
453460

454461
.. code-block:: shell
455462
456-
$ git config --global alias.pr '!sh -c "git fetch upstream pull/${1}/head:pr_${1} && git checkout pr_${1}" -'
463+
git config --global alias.pr '!sh -c "git fetch upstream pull/${1}/head:pr_${1} && git switch pr_${1}" -'
457464
458465
.. tab:: Windows
459466

460467
.. code-block:: dosbatch
461468
462-
git config --global alias.pr "!sh -c 'git fetch upstream pull/${1}/head:pr_${1} && git checkout pr_${1}' -"
469+
git config --global alias.pr "!sh -c 'git fetch upstream pull/${1}/head:pr_${1} && git switch pr_${1}' -"
463470
464471
The alias only needs to be done once. After the alias is set up, you can get a
465472
local copy of a pull request as follows::

0 commit comments

Comments
 (0)