Skip to content

Commit a1e39bf

Browse files
authored
Add inline tabs on Git Bootcamp page for commands on different systems (#1225)
* Add inline tabs on Git Bootcamp page for commands on different systems * add getOS() script * combine Unix/macOS tabs
1 parent 20979d9 commit a1e39bf

File tree

1 file changed

+17
-6
lines changed

1 file changed

+17
-6
lines changed

getting-started/git-boot-camp.rst

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,14 @@
44
Git bootcamp and cheat sheet
55
============================
66

7+
.. raw:: html
8+
9+
<script>
10+
document.addEventListener('DOMContentLoaded', function() {
11+
activateTab(getOS());
12+
});
13+
</script>
14+
715
.. highlight:: console
816

917
.. note::
@@ -439,16 +447,19 @@ Both of these tools will configure a remote URL for the branch, so you can
439447
``git push`` if the pull request author checked "Allow edits from maintainers"
440448
when creating the pull request.
441449

442-
If you don't have GitHub CLI or hub installed, you can set up a git alias. On
443-
Unix and macOS::
450+
If you don't have GitHub CLI or hub installed, you can set up a git alias:
444451

445-
$ git config --global alias.pr '!sh -c "git fetch upstream pull/${1}/head:pr_${1} && git checkout pr_${1}" -'
452+
.. tab:: Unix/macOS
446453

447-
On Windows, reverse the single (``'``) and double (``"``) quotes:
454+
.. code-block:: shell
448455
449-
.. code-block:: bash
456+
$ git config --global alias.pr '!sh -c "git fetch upstream pull/${1}/head:pr_${1} && git checkout pr_${1}" -'
457+
458+
.. tab:: Windows
459+
460+
.. code-block:: dosbatch
450461
451-
git config --global alias.pr "!sh -c 'git fetch upstream pull/${1}/head:pr_${1} && git checkout pr_${1}' -"
462+
git config --global alias.pr "!sh -c 'git fetch upstream pull/${1}/head:pr_${1} && git checkout pr_${1}' -"
452463
453464
The alias only needs to be done once. After the alias is set up, you can get a
454465
local copy of a pull request as follows::

0 commit comments

Comments
 (0)