From 7aea30d92e482625ec3f2e45dc3ea4a47f0de076 Mon Sep 17 00:00:00 2001 From: Lance Goyke Date: Sat, 18 Nov 2023 07:31:35 -0600 Subject: [PATCH 1/3] Add inline tabs on Git Bootcamp page for commands on different systems --- getting-started/git-boot-camp.rst | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/getting-started/git-boot-camp.rst b/getting-started/git-boot-camp.rst index 9b8981eb5..14be13e1d 100644 --- a/getting-started/git-boot-camp.rst +++ b/getting-started/git-boot-camp.rst @@ -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 -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}" -' + +.. 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:: From dda4b49666cbdddc9cc72b8557fc968f032748e8 Mon Sep 17 00:00:00 2001 From: Lance Goyke Date: Sat, 18 Nov 2023 11:06:21 -0600 Subject: [PATCH 2/3] add getOS() script --- getting-started/git-boot-camp.rst | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/getting-started/git-boot-camp.rst b/getting-started/git-boot-camp.rst index 14be13e1d..730d867eb 100644 --- a/getting-started/git-boot-camp.rst +++ b/getting-started/git-boot-camp.rst @@ -4,6 +4,14 @@ Git bootcamp and cheat sheet ============================ +.. raw:: html + + + .. highlight:: console .. note:: From 8f11857b21e90bda5608f5a0d32df50bcce5fb0e Mon Sep 17 00:00:00 2001 From: Lance Goyke Date: Sat, 18 Nov 2023 11:08:13 -0600 Subject: [PATCH 3/3] combine Unix/macOS tabs --- getting-started/git-boot-camp.rst | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/getting-started/git-boot-camp.rst b/getting-started/git-boot-camp.rst index 730d867eb..c38857e57 100644 --- a/getting-started/git-boot-camp.rst +++ b/getting-started/git-boot-camp.rst @@ -449,13 +449,7 @@ when creating the pull request. If you don't have GitHub CLI or hub installed, you can set up a git alias: -.. tab:: Unix - - .. code-block:: shell - - $ git config --global alias.pr '!sh -c "git fetch upstream pull/${1}/head:pr_${1} && git checkout pr_${1}" -' - -.. tab:: macOS +.. tab:: Unix/macOS .. code-block:: shell