Skip to content
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

Add inline tabs on Git Bootcamp page for commands on different systems #1225

Merged
merged 3 commits into from
Nov 19, 2023
Merged
Changes from 1 commit
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
21 changes: 15 additions & 6 deletions getting-started/git-boot-camp.rst
Original file line number Diff line number Diff line change
Expand Up @@ -439,16 +439,25 @@ 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. On
Unix and macOS::
If you don't have GitHub CLI or hub installed, you can set up a git alias:

$ git config --global alias.pr '!sh -c "git fetch upstream pull/${1}/head:pr_${1} && git checkout pr_${1}" -'
.. tab:: Unix
lancegoyke marked this conversation as resolved.
Show resolved Hide resolved

On Windows, reverse the single (``'``) and double (``"``) quotes:
.. code-block:: shell

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

.. tab:: macOS

.. code-block:: shell

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

lancegoyke marked this conversation as resolved.
Show resolved Hide resolved
.. 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 checkout 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