Skip to content

Commit

Permalink
Add inline tabs on Git Bootcamp page for commands on different systems (
Browse files Browse the repository at this point in the history
#1225)

* Add inline tabs on Git Bootcamp page for commands on different systems

* add getOS() script

* combine Unix/macOS tabs
  • Loading branch information
lancegoyke authored Nov 19, 2023
1 parent 20979d9 commit a1e39bf
Showing 1 changed file with 17 additions and 6 deletions.
23 changes: 17 additions & 6 deletions getting-started/git-boot-camp.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@
Git bootcamp and cheat sheet
============================

.. raw:: html

<script>
document.addEventListener('DOMContentLoaded', function() {
activateTab(getOS());
});
</script>

.. highlight:: console

.. note::
Expand Down Expand Up @@ -439,16 +447,19 @@ 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/macOS

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:: 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

0 comments on commit a1e39bf

Please sign in to comment.