From 4e4c41f3bcba9240f2f455075861e4edba5ed50e Mon Sep 17 00:00:00 2001 From: Rachael Sewell Date: Wed, 31 May 2023 13:22:43 -0700 Subject: [PATCH] update code fences in lists (#37251) --- .../accessing-the-management-console.md | 6 +- .../configuring-built-in-firewall-rules.md | 128 ++++++++--------- .../troubleshooting-tls-errors.md | 30 ++-- .../monitoring-cluster-nodes.md | 80 +++++------ .../upgrading-a-cluster.md | 82 +++++------ .../creating-a-high-availability-replica.md | 84 +++++------ ...ng-a-failover-to-your-replica-appliance.md | 6 +- ...ering-a-high-availability-configuration.md | 18 +-- .../removing-a-high-availability-replica.md | 24 ++-- .../monitoring-using-snmp.md | 10 +- .../increasing-storage-capacity.md | 40 +++--- ...ng-from-github-enterprise-1110x-to-2123.md | 44 +++--- .../upgrading-github-enterprise-server.md | 30 ++-- ...talling-github-enterprise-server-on-aws.md | 24 ++-- ...lling-github-enterprise-server-on-azure.md | 34 ++--- ...ing-github-enterprise-server-on-hyper-v.md | 30 ++-- .../viewing-push-logs.md | 6 +- ...-large-file-storage-for-your-enterprise.md | 98 ++++++------- ...moting-or-demoting-a-site-administrator.md | 12 +- .../suspending-and-unsuspending-users.md | 12 +- .../creating-ci-tests-with-the-checks-api.md | 6 +- .../using-the-github-api-in-your-app.md | 6 +- .../testing-your-ssh-connection.md | 36 ++--- .../about-anonymized-urls.md | 42 +++--- ...moving-sensitive-data-from-a-repository.md | 110 +++++++-------- .../reviewing-your-ssh-keys.md | 24 ++-- .../associating-an-email-with-your-gpg-key.md | 38 ++--- .../signing-commits.md | 16 +-- .../signing-tags.md | 16 +-- .../telling-git-about-your-signing-key.md | 34 ++--- .../error-permission-denied-publickey.md | 86 ++++++------ ...onfiguring-codeql-cli-in-your-ci-system.md | 8 +- .../about-codeql-packs.md | 3 +- .../getting-started-with-github-copilot.md | 24 ++-- .../associating-text-editors-with-git.md | 50 +++---- .../caching-your-github-credentials-in-git.md | 14 +- .../configuring-git-to-handle-line-endings.md | 26 ++-- .../ignoring-files.md | 6 +- .../managing-remote-repositories.md | 56 ++++---- .../quickstart/contributing-to-projects.md | 22 +-- content/get-started/quickstart/fork-a-repo.md | 52 +++---- .../using-git/about-git-subtree-merges.md | 93 ++++++------- .../support-for-subversion-clients.md | 32 ++--- .../adding-locally-hosted-code-to-github.md | 68 ++++----- ...l-git-repository-using-the-command-line.md | 26 ++-- ...l-systems-with-the-administrative-shell.md | 60 ++++---- ...tion-data-from-github-enterprise-server.md | 88 ++++++------ ...igrate-data-to-github-enterprise-server.md | 6 +- .../connecting-a-repository-to-a-package.md | 72 +++++----- .../working-with-the-container-registry.md | 36 ++--- .../working-with-the-docker-registry.md | 130 +++++++++--------- .../working-with-the-nuget-registry.md | 74 +++++----- .../working-with-the-rubygems-registry.md | 22 +-- ...ing-your-custom-domain-for-github-pages.md | 12 +- ...tom-404-page-for-your-github-pages-site.md | 10 +- ...yll-build-errors-for-github-pages-sites.md | 20 +-- ...-to-your-github-pages-site-using-jekyll.md | 10 +- ...-to-your-github-pages-site-using-jekyll.md | 22 +-- ...reating-a-github-pages-site-with-jekyll.md | 26 ++-- ...r-github-pages-site-locally-with-jekyll.md | 34 ++--- ...a-merge-conflict-using-the-command-line.md | 126 ++++++++--------- ...pull-request-branch-created-from-a-fork.md | 78 +++++------ .../checking-out-pull-requests-locally.md | 34 ++--- ...figuring-a-remote-repository-for-a-fork.md | 28 ++-- .../changing-a-commit-message.md | 80 +++++------ ...g-a-commit-on-behalf-of-an-organization.md | 10 +- ...creating-a-commit-with-multiple-authors.md | 26 ++-- .../duplicating-a-repository.md | 82 +++++------ .../moving-a-file-to-a-new-location.md | 70 +++++----- .../managing-files/renaming-a-file.md | 34 ++--- .../about-large-files-on-github.md | 28 ++-- .../configuring-git-large-file-storage.md | 26 ++-- .../installing-git-large-file-storage.md | 76 +++++----- ...oving-files-from-git-large-file-storage.md | 14 +- ...-git-large-file-storage-upload-failures.md | 12 +- .../providing-data-to-github-support.md | 26 ++-- 76 files changed, 1533 insertions(+), 1531 deletions(-) diff --git a/content/admin/configuration/administering-your-instance-from-the-management-console/accessing-the-management-console.md b/content/admin/configuration/administering-your-instance-from-the-management-console/accessing-the-management-console.md index 545e19c14c97..ee092029889e 100644 --- a/content/admin/configuration/administering-your-instance-from-the-management-console/accessing-the-management-console.md +++ b/content/admin/configuration/administering-your-instance-from-the-management-console/accessing-the-management-console.md @@ -24,8 +24,8 @@ The first time that you access the {% data variables.enterprise.management_conso ## Accessing the {% data variables.enterprise.management_console %} as an unauthenticated user 1. Visit this URL in your browser, replacing `hostname` with your actual {% data variables.product.prodname_ghe_server %} hostname or IP address: - ```shell - http(s)://HOSTNAME/setup - ``` + ```shell + http(s)://HOSTNAME/setup + ``` {% data reusables.enterprise_management_console.type-management-console-password %} {% data reusables.enterprise_management_console.click-continue-authentication %} diff --git a/content/admin/configuration/configuring-network-settings/configuring-built-in-firewall-rules.md b/content/admin/configuration/configuring-network-settings/configuring-built-in-firewall-rules.md index 7d146405739d..155bdc8c5351 100644 --- a/content/admin/configuration/configuring-network-settings/configuring-built-in-firewall-rules.md +++ b/content/admin/configuration/configuring-network-settings/configuring-built-in-firewall-rules.md @@ -30,32 +30,32 @@ We do not recommend customizing UFW as it can complicate some troubleshooting is {% data reusables.enterprise_installation.ssh-into-instance %} 2. To view the default firewall rules, use the `sudo ufw status` command. You should see output similar to this: - ```shell - $ sudo ufw status - > Status: active - > To Action From - > -- ------ ---- - > ghe-1194 ALLOW Anywhere - > ghe-122 ALLOW Anywhere - > ghe-161 ALLOW Anywhere - > ghe-22 ALLOW Anywhere - > ghe-25 ALLOW Anywhere - > ghe-443 ALLOW Anywhere - > ghe-80 ALLOW Anywhere - > ghe-8080 ALLOW Anywhere - > ghe-8443 ALLOW Anywhere - > ghe-9418 ALLOW Anywhere - > ghe-1194 (v6) ALLOW Anywhere (v6) - > ghe-122 (v6) ALLOW Anywhere (v6) - > ghe-161 (v6) ALLOW Anywhere (v6) - > ghe-22 (v6) ALLOW Anywhere (v6) - > ghe-25 (v6) ALLOW Anywhere (v6) - > ghe-443 (v6) ALLOW Anywhere (v6) - > ghe-80 (v6) ALLOW Anywhere (v6) - > ghe-8080 (v6) ALLOW Anywhere (v6) - > ghe-8443 (v6) ALLOW Anywhere (v6) - > ghe-9418 (v6) ALLOW Anywhere (v6) - ``` + ```shell + $ sudo ufw status + > Status: active + > To Action From + > -- ------ ---- + > ghe-1194 ALLOW Anywhere + > ghe-122 ALLOW Anywhere + > ghe-161 ALLOW Anywhere + > ghe-22 ALLOW Anywhere + > ghe-25 ALLOW Anywhere + > ghe-443 ALLOW Anywhere + > ghe-80 ALLOW Anywhere + > ghe-8080 ALLOW Anywhere + > ghe-8443 ALLOW Anywhere + > ghe-9418 ALLOW Anywhere + > ghe-1194 (v6) ALLOW Anywhere (v6) + > ghe-122 (v6) ALLOW Anywhere (v6) + > ghe-161 (v6) ALLOW Anywhere (v6) + > ghe-22 (v6) ALLOW Anywhere (v6) + > ghe-25 (v6) ALLOW Anywhere (v6) + > ghe-443 (v6) ALLOW Anywhere (v6) + > ghe-80 (v6) ALLOW Anywhere (v6) + > ghe-8080 (v6) ALLOW Anywhere (v6) + > ghe-8443 (v6) ALLOW Anywhere (v6) + > ghe-9418 (v6) ALLOW Anywhere (v6) + ``` ## Adding custom firewall rules @@ -67,13 +67,13 @@ We do not recommend customizing UFW as it can complicate some troubleshooting is 1. Configure a custom firewall rule. 2. Check the status of each new rule with the `status numbered` command. - ```shell - $ sudo ufw status numbered - ``` + ```shell + $ sudo ufw status numbered + ``` 3. To back up your custom firewall rules, use the `cp`command to move the rules to a new file. - ```shell - $ sudo cp -r /etc/ufw ~/ufw.backup - ``` + ```shell + $ sudo cp -r /etc/ufw ~/ufw.backup + ``` After you upgrade {% data variables.location.product_location %}, you must reapply your custom firewall rules. We recommend that you create a script to reapply your firewall custom rules. @@ -89,37 +89,37 @@ If something goes wrong after you change the firewall rules, you can reset the r {% data reusables.enterprise_installation.ssh-into-instance %} 2. To restore the previous backup rules, copy them back to the firewall with the `cp` command. - ```shell - $ sudo cp -f ~/ufw.backup/*rules /etc/ufw - ``` + ```shell + $ sudo cp -f ~/ufw.backup/*rules /etc/ufw + ``` 3. Restart the firewall with the `systemctl` command. - ```shell - $ sudo systemctl restart ufw - ``` + ```shell + $ sudo systemctl restart ufw + ``` 4. Confirm that the rules are back to their defaults with the `ufw status` command. - ```shell - $ sudo ufw status - > Status: active - > To Action From - > -- ------ ---- - > ghe-1194 ALLOW Anywhere - > ghe-122 ALLOW Anywhere - > ghe-161 ALLOW Anywhere - > ghe-22 ALLOW Anywhere - > ghe-25 ALLOW Anywhere - > ghe-443 ALLOW Anywhere - > ghe-80 ALLOW Anywhere - > ghe-8080 ALLOW Anywhere - > ghe-8443 ALLOW Anywhere - > ghe-9418 ALLOW Anywhere - > ghe-1194 (v6) ALLOW Anywhere (v6) - > ghe-122 (v6) ALLOW Anywhere (v6) - > ghe-161 (v6) ALLOW Anywhere (v6) - > ghe-22 (v6) ALLOW Anywhere (v6) - > ghe-25 (v6) ALLOW Anywhere (v6) - > ghe-443 (v6) ALLOW Anywhere (v6) - > ghe-80 (v6) ALLOW Anywhere (v6) - > ghe-8080 (v6) ALLOW Anywhere (v6) - > ghe-8443 (v6) ALLOW Anywhere (v6) - > ghe-9418 (v6) ALLOW Anywhere (v6) - ``` + ```shell + $ sudo ufw status + > Status: active + > To Action From + > -- ------ ---- + > ghe-1194 ALLOW Anywhere + > ghe-122 ALLOW Anywhere + > ghe-161 ALLOW Anywhere + > ghe-22 ALLOW Anywhere + > ghe-25 ALLOW Anywhere + > ghe-443 ALLOW Anywhere + > ghe-80 ALLOW Anywhere + > ghe-8080 ALLOW Anywhere + > ghe-8443 ALLOW Anywhere + > ghe-9418 ALLOW Anywhere + > ghe-1194 (v6) ALLOW Anywhere (v6) + > ghe-122 (v6) ALLOW Anywhere (v6) + > ghe-161 (v6) ALLOW Anywhere (v6) + > ghe-22 (v6) ALLOW Anywhere (v6) + > ghe-25 (v6) ALLOW Anywhere (v6) + > ghe-443 (v6) ALLOW Anywhere (v6) + > ghe-80 (v6) ALLOW Anywhere (v6) + > ghe-8080 (v6) ALLOW Anywhere (v6) + > ghe-8443 (v6) ALLOW Anywhere (v6) + > ghe-9418 (v6) ALLOW Anywhere (v6) + ``` diff --git a/content/admin/configuration/configuring-your-enterprise/troubleshooting-tls-errors.md b/content/admin/configuration/configuring-your-enterprise/troubleshooting-tls-errors.md index 35d477d6e0b7..f19a7e07fc81 100644 --- a/content/admin/configuration/configuring-your-enterprise/troubleshooting-tls-errors.md +++ b/content/admin/configuration/configuring-your-enterprise/troubleshooting-tls-errors.md @@ -25,13 +25,13 @@ shortTitle: Troubleshoot TLS errors If you have a Linux machine with OpenSSL installed, you can remove your passphrase. 1. Rename your original key file. - ```shell - $ mv yourdomain.key yourdomain.key.orig - ``` + ```shell + $ mv yourdomain.key yourdomain.key.orig + ``` 2. Generate a new key without a passphrase. - ```shell - $ openssl rsa -in yourdomain.key.orig -out yourdomain.key - ``` + ```shell + $ openssl rsa -in yourdomain.key.orig -out yourdomain.key + ``` You'll be prompted for the key's passphrase when you run this command. @@ -69,17 +69,17 @@ If your {% data variables.product.prodname_ghe_server %} appliance interacts wit 1. Obtain the CA's root certificate from your local certificate authority and ensure it is in PEM format. 2. Copy the file to your {% data variables.product.prodname_ghe_server %} appliance over SSH as the "admin" user on port 122. - ```shell - $ scp -P 122 rootCA.crt admin@HOSTNAME:/home/admin - ``` + ```shell + $ scp -P 122 rootCA.crt admin@HOSTNAME:/home/admin + ``` 3. Connect to the {% data variables.product.prodname_ghe_server %} administrative shell over SSH as the "admin" user on port 122. - ```shell - $ ssh -p 122 admin@HOSTNAME - ``` + ```shell + $ ssh -p 122 admin@HOSTNAME + ``` 4. Import the certificate into the system-wide certificate store. - ```shell - $ ghe-ssl-ca-certificate-install -c rootCA.crt - ``` + ```shell + $ ghe-ssl-ca-certificate-install -c rootCA.crt + ``` ## Updating a TLS certificate diff --git a/content/admin/enterprise-management/configuring-clustering/monitoring-cluster-nodes.md b/content/admin/enterprise-management/configuring-clustering/monitoring-cluster-nodes.md index 1405e221817d..36e87d4b3239 100644 --- a/content/admin/enterprise-management/configuring-clustering/monitoring-cluster-nodes.md +++ b/content/admin/enterprise-management/configuring-clustering/monitoring-cluster-nodes.md @@ -48,33 +48,33 @@ You can configure [Nagios](https://www.nagios.org/) to monitor {% data variables ### Configuring the Nagios host 1. Generate an SSH key with a blank passphrase. Nagios uses this to authenticate to the {% data variables.product.prodname_ghe_server %} cluster. - ```shell - nagiosuser@nagios:~$ ssh-keygen -t ed25519 - > Generating public/private ed25519 key pair. - > Enter file in which to save the key (/home/nagiosuser/.ssh/id_ed25519): - > Enter passphrase (empty for no passphrase): LEAVE BLANK BY PRESSING ENTER - > Enter same passphrase again: PRESS ENTER AGAIN - > Your identification has been saved in /home/nagiosuser/.ssh/id_ed25519. - > Your public key has been saved in /home/nagiosuser/.ssh/id_ed25519.pub. - ``` - {% danger %} - - **Security Warning:** An SSH key without a passphrase can pose a security risk if authorized for full access to a host. Limit this key's authorization to a single read-only command. - - {% enddanger %} - {% note %} - - **Note:** If you're using a distribution of Linux that doesn't support the Ed25519 algorithm, use the command: - ```shell - nagiosuser@nagios:~$ ssh-keygen -t rsa -b 4096 - ``` - - {% endnote %} + ```shell + nagiosuser@nagios:~$ ssh-keygen -t ed25519 + > Generating public/private ed25519 key pair. + > Enter file in which to save the key (/home/nagiosuser/.ssh/id_ed25519): + > Enter passphrase (empty for no passphrase): LEAVE BLANK BY PRESSING ENTER + > Enter same passphrase again: PRESS ENTER AGAIN + > Your identification has been saved in /home/nagiosuser/.ssh/id_ed25519. + > Your public key has been saved in /home/nagiosuser/.ssh/id_ed25519.pub. + ``` + {% danger %} + + **Security Warning:** An SSH key without a passphrase can pose a security risk if authorized for full access to a host. Limit this key's authorization to a single read-only command. + + {% enddanger %} + {% note %} + + **Note:** If you're using a distribution of Linux that doesn't support the Ed25519 algorithm, use the command: + ```shell + nagiosuser@nagios:~$ ssh-keygen -t rsa -b 4096 + ``` + + {% endnote %} 2. Copy the private key (`id_ed25519`) to the `nagios` home folder and set the appropriate ownership. - ```shell - nagiosuser@nagios:~$ sudo cp .ssh/id_ed25519 /var/lib/nagios/.ssh/ - nagiosuser@nagios:~$ sudo chown nagios:nagios /var/lib/nagios/.ssh/id_ed25519 - ``` + ```shell + nagiosuser@nagios:~$ sudo cp .ssh/id_ed25519 /var/lib/nagios/.ssh/ + nagiosuser@nagios:~$ sudo chown nagios:nagios /var/lib/nagios/.ssh/id_ed25519 + ``` 3. To authorize the public key to run *only* the `ghe-cluster-status -n` command, use a `command=` prefix in the `/data/user/common/authorized_keys` file. From the administrative shell on any node, modify this file to add the public key generated in step 1. For example: `command="/usr/local/bin/ghe-cluster-status -n" ssh-ed25519 AAAA....` @@ -88,39 +88,39 @@ You can configure [Nagios](https://www.nagios.org/) to monitor {% data variables ``` 5. To test that the Nagios plugin can successfully execute the command, run it interactively from Nagios host. - ```shell - nagiosuser@nagios:~$ /usr/lib/nagios/plugins/check_by_ssh -l admin -p 122 -H HOSTNAME -C "ghe-cluster-status -n" -t 30 - > OK - No errors detected - ``` + ```shell + nagiosuser@nagios:~$ /usr/lib/nagios/plugins/check_by_ssh -l admin -p 122 -H HOSTNAME -C "ghe-cluster-status -n" -t 30 + > OK - No errors detected + ``` 6. Create a command definition in your Nagios configuration. - **Example definition** + **Example definition** - ``` - define command { + ``` + define command { command_name check_ssh_ghe_cluster command_line $USER1$/check_by_ssh -H $HOSTADDRESS$ -C "ghe-cluster-status -n" -l admin -p 122 -t 30 - } - ``` + } + ``` 7. Add this command to a service definition for a node in the {% data variables.product.prodname_ghe_server %} cluster. - **Example definition** + **Example definition** - ``` - define host{ + ``` + define host{ use generic-host host_name ghe-data-node-0 alias ghe-data-node-0 address 10.11.17.180 } - define service{ + define service{ use generic-service host_name ghe-data-node-0 service_description GitHub Cluster Status check_command check_ssh_ghe_cluster } - ``` + ``` After you add the definition to Nagios, the service check executes according to your configuration. You should be able to see the newly configured service in the Nagios web interface. diff --git a/content/admin/enterprise-management/configuring-clustering/upgrading-a-cluster.md b/content/admin/enterprise-management/configuring-clustering/upgrading-a-cluster.md index 43a5a41d0f14..936c87ff247b 100644 --- a/content/admin/enterprise-management/configuring-clustering/upgrading-a-cluster.md +++ b/content/admin/enterprise-management/configuring-clustering/upgrading-a-cluster.md @@ -18,9 +18,9 @@ topics: 1. Back up your data with [{% data variables.product.prodname_enterprise_backup_utilities %}](https://github.com/github/backup-utils#readme). 2. From the administrative shell of any node, use the `ghe-cluster-hotpatch` command to install the latest hotpatch. You can provide a URL for a hotpatch, or manually download the hotpatch and specify a local filename. - ```shell - $ ghe-cluster-hotpatch https://HOTPATCH-URL/FILENAME.hpkg - ``` + ```shell + $ ghe-cluster-hotpatch https://HOTPATCH-URL/FILENAME.hpkg + ``` ## Upgrading with an upgrade package Use an upgrade package to upgrade a {% data variables.product.prodname_ghe_server %} cluster to the latest feature release. For example, you can upgrade from `2.11` to `2.13`. @@ -32,24 +32,24 @@ Use an upgrade package to upgrade a {% data variables.product.prodname_ghe_serve 3. Schedule a maintenance window for end users of your {% data variables.product.prodname_ghe_server %} cluster, as it will be unavailable for normal use during the upgrade. Maintenance mode blocks user access and prevents data changes while the cluster upgrade is in progress. 4. On the [{% data variables.product.prodname_ghe_server %} Download Page](https://enterprise.github.com/download), copy the URL for the upgrade *.pkg* file to the clipboard. 5. From the administrative shell of any node, use the `ghe-cluster-each` command combined with `curl` to download the release package to each node in a single step. Use the URL you copied in the previous step as an argument. - ```shell - $ ghe-cluster-each -- "cd /home/admin && curl -L -O https://PACKAGE-URL.pkg" - > ghe-app-node-1: % Total % Received % Xferd Average Speed Time Time Time Current - > ghe-app-node-1: Dload Upload Total Spent Left Speed - > 100 496M 100 496M 0 0 24.2M 0 0:00:20 0:00:20 --:--:-- 27.4M - > ghe-data-node-2: % Total % Received % Xferd Average Speed Time Time Time Current - > ghe-data-node-2: Dload Upload Total Spent Left Speed - > 100 496M 100 496M 0 0 21.3M 0 0:00:23 0:00:23 --:--:-- 25.8M - > ghe-data-node-1: % Total % Received % Xferd Average Speed Time Time Time Current - > ghe-data-node-1: Dload Upload Total Spent Left Speed - > 100 496M 100 496M 0 0 19.7M 0 0:00:25 0:00:25 --:--:-- 25.6M - > ghe-app-node-2: % Total % Received % Xferd Average Speed Time Time Time Current - > ghe-app-node-2: Dload Upload Total Spent Left Speed - > 100 496M 100 496M 0 0 19.8M 0 0:00:25 0:00:25 --:--:-- 17.6M - > ghe-data-node-3: % Total % Received % Xferd Average Speed Time Time Time Current - > ghe-data-node-3: Dload Upload Total Spent Left Speed - > 100 496M 100 496M 0 0 19.7M 0 0:00:25 0:00:25 --:--:-- 25.5M - ``` + ```shell + $ ghe-cluster-each -- "cd /home/admin && curl -L -O https://PACKAGE-URL.pkg" + > ghe-app-node-1: % Total % Received % Xferd Average Speed Time Time Time Current + > ghe-app-node-1: Dload Upload Total Spent Left Speed + > 100 496M 100 496M 0 0 24.2M 0 0:00:20 0:00:20 --:--:-- 27.4M + > ghe-data-node-2: % Total % Received % Xferd Average Speed Time Time Time Current + > ghe-data-node-2: Dload Upload Total Spent Left Speed + > 100 496M 100 496M 0 0 21.3M 0 0:00:23 0:00:23 --:--:-- 25.8M + > ghe-data-node-1: % Total % Received % Xferd Average Speed Time Time Time Current + > ghe-data-node-1: Dload Upload Total Spent Left Speed + > 100 496M 100 496M 0 0 19.7M 0 0:00:25 0:00:25 --:--:-- 25.6M + > ghe-app-node-2: % Total % Received % Xferd Average Speed Time Time Time Current + > ghe-app-node-2: Dload Upload Total Spent Left Speed + > 100 496M 100 496M 0 0 19.8M 0 0:00:25 0:00:25 --:--:-- 17.6M + > ghe-data-node-3: % Total % Received % Xferd Average Speed Time Time Time Current + > ghe-data-node-3: Dload Upload Total Spent Left Speed + > 100 496M 100 496M 0 0 19.7M 0 0:00:25 0:00:25 --:--:-- 25.5M + ``` 6. Identify the primary MySQL node, which is defined as `mysql-master = ` in `cluster.conf`. This node will be upgraded last. ### Upgrading the cluster nodes @@ -57,28 +57,28 @@ Use an upgrade package to upgrade a {% data variables.product.prodname_ghe_serve 1. Enable maintenance mode according to your scheduled window by connecting to the administrative shell of any cluster node and running `ghe-cluster-maintenance -s`. 2. **With the exception of the primary MySQL node**, connect to the administrative shell of each of the {% data variables.product.prodname_ghe_server %} nodes. Run the `ghe-upgrade` command, providing the package file name you downloaded in Step 4 of [Preparing to upgrade](#preparing-to-upgrade): - ```shell - $ ghe-upgrade PACKAGE-FILENAME.pkg - > *** verifying upgrade package signature... - > 497MB 0:00:04 [ 117MB/s] [==========================================>] 100% - > gpg: Signature made Fri 19 Feb 2016 02:33:50 PM UTC using RSA key ID 0D65D57A - > gpg: checking the trustdb - > gpg: 3 marginal(s) needed, 1 complete(s) needed, PGP trust model - > gpg: depth: 0 valid: 1 signed: 0 trust: 0-, 0q, 0n, 0m, 0f, 1u - > gpg: Good signature from "GitHub Enterprise (Upgrade Package Key) > " - ``` + ```shell + $ ghe-upgrade PACKAGE-FILENAME.pkg + > *** verifying upgrade package signature... + > 497MB 0:00:04 [ 117MB/s] [==========================================>] 100% + > gpg: Signature made Fri 19 Feb 2016 02:33:50 PM UTC using RSA key ID 0D65D57A + > gpg: checking the trustdb + > gpg: 3 marginal(s) needed, 1 complete(s) needed, PGP trust model + > gpg: depth: 0 valid: 1 signed: 0 trust: 0-, 0q, 0n, 0m, 0f, 1u + > gpg: Good signature from "GitHub Enterprise (Upgrade Package Key) > " + ``` 3. The upgrade process will reboot the node once it completes. Verify that you can `ping` each node after it reboots. 4. Connect to the administrative shell of the primary MySQL node. Run the `ghe-upgrade` command, providing the package file name you downloaded in Step 4 of [Preparing to upgrade](#preparing-to-upgrade): - ```shell - $ ghe-upgrade PACKAGE-FILENAME.pkg - > *** verifying upgrade package signature... - > 497MB 0:00:04 [ 117MB/s] [==========================================>] 100% - > gpg: Signature made Fri 19 Feb 2016 02:33:50 PM UTC using RSA key ID 0D65D57A - > gpg: checking the trustdb - > gpg: 3 marginal(s) needed, 1 complete(s) needed, PGP trust model - > gpg: depth: 0 valid: 1 signed: 0 trust: 0-, 0q, 0n, 0m, 0f, 1u - > gpg: Good signature from "GitHub Enterprise (Upgrade Package Key) > " - ``` + ```shell + $ ghe-upgrade PACKAGE-FILENAME.pkg + > *** verifying upgrade package signature... + > 497MB 0:00:04 [ 117MB/s] [==========================================>] 100% + > gpg: Signature made Fri 19 Feb 2016 02:33:50 PM UTC using RSA key ID 0D65D57A + > gpg: checking the trustdb + > gpg: 3 marginal(s) needed, 1 complete(s) needed, PGP trust model + > gpg: depth: 0 valid: 1 signed: 0 trust: 0-, 0q, 0n, 0m, 0f, 1u + > gpg: Good signature from "GitHub Enterprise (Upgrade Package Key) > " + ``` 5. The upgrade process will reboot the primary MySQL node once it completes. Verify that you can `ping` each node after it reboots.{% ifversion ghes %} 6. Connect to the administrative shell of the primary MySQL node and run the `ghe-cluster-config-apply` command. 7. When `ghe-cluster-config-apply` is complete, check that the services are in a healthy state by running `ghe-cluster-status`.{% endif %} diff --git a/content/admin/enterprise-management/configuring-high-availability/creating-a-high-availability-replica.md b/content/admin/enterprise-management/configuring-high-availability/creating-a-high-availability-replica.md index f500b00a3972..032caaf12aba 100644 --- a/content/admin/enterprise-management/configuring-high-availability/creating-a-high-availability-replica.md +++ b/content/admin/enterprise-management/configuring-high-availability/creating-a-high-availability-replica.md @@ -23,15 +23,15 @@ shortTitle: Create HA replica 1. In a browser, navigate to the new replica appliance's IP address and upload your {% data variables.product.prodname_enterprise %} license. {% data reusables.enterprise_installation.replica-steps %} 1. Connect to the replica appliance's IP address using SSH. - ```shell - $ ssh -p 122 admin@REPLICA_IP - ``` + ```shell + $ ssh -p 122 admin@REPLICA_IP + ``` {% data reusables.enterprise_installation.generate-replication-key-pair %} {% data reusables.enterprise_installation.add-ssh-key-to-primary %} 1. To verify the connection to the primary and enable replica mode for the new replica, run `ghe-repl-setup` again. - ```shell - $ ghe-repl-setup PRIMARY_IP - ``` + ```shell + $ ghe-repl-setup PRIMARY_IP + ``` {% data reusables.enterprise_installation.replication-command %} {% data reusables.enterprise_installation.verify-replication-channel %} @@ -42,48 +42,48 @@ This example configuration uses a primary and two replicas, which are located in {% data reusables.enterprise_clustering.network-latency %} If latency is more than 70 milliseconds, we recommend cache replica nodes instead. For more information, see "[AUTOTITLE](/admin/enterprise-management/caching-repositories/configuring-a-repository-cache)." 1. Create the first replica the same way you would for a standard two node configuration by running `ghe-repl-setup` on the first replica. - ```shell - (replica1)$ ghe-repl-setup PRIMARY_IP - (replica1)$ ghe-repl-start - ``` + ```shell + (replica1)$ ghe-repl-setup PRIMARY_IP + (replica1)$ ghe-repl-start + ``` 2. Create a second replica and use the `ghe-repl-setup --add` command. The `--add` flag prevents it from overwriting the existing replication configuration and adds the new replica to the configuration. - ```shell - (replica2)$ ghe-repl-setup --add PRIMARY_IP - (replica2)$ ghe-repl-start - ``` + ```shell + (replica2)$ ghe-repl-setup --add PRIMARY_IP + (replica2)$ ghe-repl-start + ``` 3. By default, replicas are configured to the same datacenter, and will now attempt to seed from an existing node in the same datacenter. Configure the replicas for different datacenters by setting a different value for the datacenter option. The specific values can be anything you would like as long as they are different from each other. Run the `ghe-repl-node` command on each node and specify the datacenter. - On the primary: - ```shell - (primary)$ ghe-repl-node --datacenter [PRIMARY DC NAME] - ``` - On the first replica: - ```shell - (replica1)$ ghe-repl-node --datacenter [FIRST REPLICA DC NAME] - ``` - On the second replica: - ```shell - (replica2)$ ghe-repl-node --datacenter [SECOND REPLICA DC NAME] - ``` - {% tip %} - - **Tip:** You can set the `--datacenter` and `--active` options at the same time. - - {% endtip %} + On the primary: + ```shell + (primary)$ ghe-repl-node --datacenter [PRIMARY DC NAME] + ``` + On the first replica: + ```shell + (replica1)$ ghe-repl-node --datacenter [FIRST REPLICA DC NAME] + ``` + On the second replica: + ```shell + (replica2)$ ghe-repl-node --datacenter [SECOND REPLICA DC NAME] + ``` + {% tip %} + + **Tip:** You can set the `--datacenter` and `--active` options at the same time. + + {% endtip %} 4. An active replica node will store copies of the appliance data and service end user requests. An inactive node will store copies of the appliance data but will be unable to service end user requests. Enable active mode using the `--active` flag or inactive mode using the `--inactive` flag. - On the first replica: - ```shell - (replica1)$ ghe-repl-node --active - ``` - On the second replica: - ```shell - (replica2)$ ghe-repl-node --active - ``` + On the first replica: + ```shell + (replica1)$ ghe-repl-node --active + ``` + On the second replica: + ```shell + (replica2)$ ghe-repl-node --active + ``` 5. To apply the configuration, use the `ghe-config-apply` command on the primary. - ```shell - (primary)$ ghe-config-apply - ``` + ```shell + (primary)$ ghe-config-apply + ``` ## Configuring DNS for geo-replication diff --git a/content/admin/enterprise-management/configuring-high-availability/initiating-a-failover-to-your-replica-appliance.md b/content/admin/enterprise-management/configuring-high-availability/initiating-a-failover-to-your-replica-appliance.md index b99c3c4d9761..cd418d408866 100644 --- a/content/admin/enterprise-management/configuring-high-availability/initiating-a-failover-to-your-replica-appliance.md +++ b/content/admin/enterprise-management/configuring-high-availability/initiating-a-failover-to-your-replica-appliance.md @@ -44,9 +44,9 @@ The time required to failover depends on how long it takes to manually promote t ``` 4. On the replica appliance, to stop replication and promote the replica appliance to primary status, use the `ghe-repl-promote` command. This will also automatically put the primary node in maintenance mode if it’s reachable. - ```shell - $ ghe-repl-promote - ``` + ```shell + $ ghe-repl-promote + ``` {% note %} diff --git a/content/admin/enterprise-management/configuring-high-availability/recovering-a-high-availability-configuration.md b/content/admin/enterprise-management/configuring-high-availability/recovering-a-high-availability-configuration.md index ec205b546864..f7f8c3b2e48e 100644 --- a/content/admin/enterprise-management/configuring-high-availability/recovering-a-high-availability-configuration.md +++ b/content/admin/enterprise-management/configuring-high-availability/recovering-a-high-availability-configuration.md @@ -28,17 +28,17 @@ You can use the former primary appliance as the new replica appliance if the fai ## Configuring a former primary appliance as a new replica 1. Connect to the former primary appliance's IP address using SSH. - ```shell - $ ssh -p 122 admin@ FORMER_PRIMARY_IP - ``` + ```shell + $ ssh -p 122 admin@ FORMER_PRIMARY_IP + ``` 1. Enable maintenance mode on the former primary appliance. For more information, see "[AUTOTITLE](/admin/configuration/configuring-your-enterprise/enabling-and-scheduling-maintenance-mode)." 1. On the former primary appliance, run `ghe-repl-setup` with the IP address of the former replica. - ```shell - $ ghe-repl-setup FORMER_REPLICA_IP - ``` + ```shell + $ ghe-repl-setup FORMER_REPLICA_IP + ``` {% data reusables.enterprise_installation.add-ssh-key-to-primary %} 1. To verify the connection to the new primary and enable replica mode for the new replica, run `ghe-repl-setup` again. - ```shell - $ ghe-repl-setup FORMER_REPLICA_IP - ``` + ```shell + $ ghe-repl-setup FORMER_REPLICA_IP + ``` {% data reusables.enterprise_installation.replication-command %} diff --git a/content/admin/enterprise-management/configuring-high-availability/removing-a-high-availability-replica.md b/content/admin/enterprise-management/configuring-high-availability/removing-a-high-availability-replica.md index 638b461999e3..6e88e9c89403 100644 --- a/content/admin/enterprise-management/configuring-high-availability/removing-a-high-availability-replica.md +++ b/content/admin/enterprise-management/configuring-high-availability/removing-a-high-availability-replica.md @@ -19,25 +19,25 @@ shortTitle: Remove a HA replica 1. If necessary, stop a geo-replication replica from serving user traffic by removing the Geo DNS entries for the replica. 2. On the replica where you wish to temporarily stop replication, run ghe-repl-stop. - ```shell - $ ghe-repl-stop - ``` + ```shell + $ ghe-repl-stop + ``` 3. To start replication again, run `ghe-repl-start`. - ```shell - $ ghe-repl-start - ``` + ```shell + $ ghe-repl-start + ``` ## Removing replication permanently 1. If necessary, stop a geo-replication replica from serving user traffic by removing the Geo DNS entries for the replica. 2. On the replica you wish to remove replication from, run `ghe-repl-stop`. - ```shell - $ ghe-repl-stop - ``` + ```shell + $ ghe-repl-stop + ``` 3. On the replica, to tear down the replication state, run `ghe-repl-teardown`. - ```shell - $ ghe-repl-teardown - ``` + ```shell + $ ghe-repl-teardown + ``` {% ifversion ghes %} {% note %} diff --git a/content/admin/enterprise-management/monitoring-your-appliance/monitoring-using-snmp.md b/content/admin/enterprise-management/monitoring-your-appliance/monitoring-using-snmp.md index 84e0c77bfa7a..7b3d2d3fc085 100644 --- a/content/admin/enterprise-management/monitoring-your-appliance/monitoring-using-snmp.md +++ b/content/admin/enterprise-management/monitoring-your-appliance/monitoring-using-snmp.md @@ -28,11 +28,11 @@ SNMP is a common standard for monitoring devices over a network. We strongly rec 4. In the **Community string** field, enter a new community string. If left blank, this defaults to `public`. {% data reusables.enterprise_management_console.save-settings %} 5. Test your SNMP configuration by running the following command on a separate workstation with SNMP support in your network: - ```shell - # community-string is your community string - # hostname is the IP or domain of your Enterprise instance - $ snmpget -v 2c -c COMMUNITY-STRING -O e HOSTNAME hrSystemDate.0 - ``` + ```shell + # community-string is your community string + # hostname is the IP or domain of your Enterprise instance + $ snmpget -v 2c -c COMMUNITY-STRING -O e HOSTNAME hrSystemDate.0 + ``` This should return the system time on {% data variables.location.product_location %} host. diff --git a/content/admin/enterprise-management/updating-the-virtual-machine-and-physical-resources/increasing-storage-capacity.md b/content/admin/enterprise-management/updating-the-virtual-machine-and-physical-resources/increasing-storage-capacity.md index 40c19cd2fde0..eabb7b8ac35f 100644 --- a/content/admin/enterprise-management/updating-the-virtual-machine-and-physical-resources/increasing-storage-capacity.md +++ b/content/admin/enterprise-management/updating-the-virtual-machine-and-physical-resources/increasing-storage-capacity.md @@ -37,22 +37,22 @@ As more users join {% data variables.location.product_location %}, you may need {% data reusables.enterprise_installation.ssh-into-instance %} 3. Put the appliance in maintenance mode. For more information, see "[AUTOTITLE](/admin/configuration/configuring-your-enterprise/enabling-and-scheduling-maintenance-mode)." 4. Reboot the appliance to detect the new storage allocation: - ```shell - $ sudo reboot - ``` + ```shell + $ sudo reboot + ``` 5. Run the `ghe-storage-extend` command to expand the `/data/user` filesystem: - ```shell - $ ghe-storage-extend - ``` + ```shell + $ ghe-storage-extend + ``` 6. Ensure system services are functioning correctly, then release maintenance mode. For more information, see "[AUTOTITLE](/admin/configuration/configuring-your-enterprise/enabling-and-scheduling-maintenance-mode)." ## Increasing the root partition size using a new appliance 1. Set up a new {% data variables.product.prodname_ghe_server %} instance with a larger root disk using the same version as your current appliance. For more information, see "[AUTOTITLE](/admin/installation/setting-up-a-github-enterprise-server-instance)." 2. Shut down the current appliance: - ```shell - $ sudo poweroff - ``` + ```shell + $ sudo poweroff + ``` 3. Detach the data disk from the current appliance using your virtualization platform's tools. 4. Attach the data disk to the new appliance with the larger root disk. @@ -67,11 +67,11 @@ As more users join {% data variables.location.product_location %}, you may need 1. Attach a new disk to your {% data variables.product.prodname_ghe_server %} appliance. 1. Run the `lsblk` command to identify the new disk's device name. 1. Run the `parted` command to format the disk, substituting your device name for `/dev/xvdg`: - ```shell - $ sudo parted /dev/xvdg mklabel msdos - $ sudo parted /dev/xvdg mkpart primary ext4 0% 50% - $ sudo parted /dev/xvdg mkpart primary ext4 50% 100% - ``` + ```shell + $ sudo parted /dev/xvdg mklabel msdos + $ sudo parted /dev/xvdg mkpart primary ext4 0% 50% + $ sudo parted /dev/xvdg mkpart primary ext4 50% 100% + ``` 1. If your appliance is configured for high-availability or geo-replication, to stop replication run the `ghe-repl-stop` command on each replica node: ```shell @@ -80,13 +80,13 @@ As more users join {% data variables.location.product_location %}, you may need 1. To install the {% data variables.product.prodname_ghe_server %} software on the newly partitioned disk, run the `ghe-upgrade` command. You must replace **PACKAGE-NAME.pkg** with the path to a platform-specific upgrade package that matches the version of {% data variables.product.prodname_ghe_server %} already running on the appliance. You cannot use a universal hotpatch upgrade package, such as `github-enterprise-2.11.9.hpkg`. After the `ghe-upgrade` command completes, application services will automatically terminate. - ```shell - $ ghe-upgrade PACKAGE-NAME.pkg -s -t /dev/xvdg1 - ``` + ```shell + $ ghe-upgrade PACKAGE-NAME.pkg -s -t /dev/xvdg1 + ``` 1. Shut down the appliance: - ```shell - $ sudo poweroff - ``` + ```shell + $ sudo poweroff + ``` 1. In the hypervisor, remove the old root disk and attach the new root disk at the same location as the old root disk. 1. Start the appliance. 1. Ensure system services are functioning correctly, then release maintenance mode. For more information, see "[AUTOTITLE](/admin/configuration/configuring-your-enterprise/enabling-and-scheduling-maintenance-mode)." diff --git a/content/admin/enterprise-management/updating-the-virtual-machine-and-physical-resources/migrating-from-github-enterprise-1110x-to-2123.md b/content/admin/enterprise-management/updating-the-virtual-machine-and-physical-resources/migrating-from-github-enterprise-1110x-to-2123.md index f4555aaf79d1..a9c5b73bf8b3 100644 --- a/content/admin/enterprise-management/updating-the-virtual-machine-and-physical-resources/migrating-from-github-enterprise-1110x-to-2123.md +++ b/content/admin/enterprise-management/updating-the-virtual-machine-and-physical-resources/migrating-from-github-enterprise-1110x-to-2123.md @@ -63,35 +63,35 @@ To upgrade to the latest version of {% data variables.product.prodname_enterpris 10. On the backup host, run the `ghe-backup` command to take a final backup snapshot. This ensures that all data from the old instance is captured. 11. On the backup host, run the `ghe-restore` command you copied on the new instance's restore status screen to restore the latest snapshot. - ```shell - $ ghe-restore 169.254.1.1 - The authenticity of host '169.254.1.1:122' can't be established. - RSA key fingerprint is fe:96:9e:ac:d0:22:7c:cf:22:68:f2:c3:c9:81:53:d1. - Are you sure you want to continue connecting (yes/no)? yes - Connect 169.254.1.1:122 OK (v2.0.0) - Starting restore of 169.254.1.1:122 from snapshot 20141014T141425 - Restoring Git repositories ... - Restoring GitHub Pages ... - Restoring asset attachments ... - Restoring hook deliveries ... - Restoring MySQL database ... - Restoring Redis database ... - Restoring SSH authorized keys ... - Restoring Elasticsearch indices ... - Restoring SSH host keys ... - Completed restore of 169.254.1.1:122 from snapshot 20141014T141425 - Visit https://169.254.1.1/setup/settings to review appliance configuration. - ``` + ```shell + $ ghe-restore 169.254.1.1 + The authenticity of host '169.254.1.1:122' can't be established. + RSA key fingerprint is fe:96:9e:ac:d0:22:7c:cf:22:68:f2:c3:c9:81:53:d1. + Are you sure you want to continue connecting (yes/no)? yes + Connect 169.254.1.1:122 OK (v2.0.0) + Starting restore of 169.254.1.1:122 from snapshot 20141014T141425 + Restoring Git repositories ... + Restoring GitHub Pages ... + Restoring asset attachments ... + Restoring hook deliveries ... + Restoring MySQL database ... + Restoring Redis database ... + Restoring SSH authorized keys ... + Restoring Elasticsearch indices ... + Restoring SSH host keys ... + Completed restore of 169.254.1.1:122 from snapshot 20141014T141425 + Visit https://169.254.1.1/setup/settings to review appliance configuration. + ``` 12. Return to the new instance's restore status screen to see that the restore completed. 13. Click **Continue to settings** to review and adjust the configuration information and settings that were imported from the previous instance. 14. Click **Save settings**. - {% note %} + {% note %} - **Note:** You can use the new instance after you've applied configuration settings and restarted the server. + **Note:** You can use the new instance after you've applied configuration settings and restarted the server. - {% endnote %} + {% endnote %} 15. Switch user network traffic from the old instance to the new instance using either DNS or IP address assignment. 16. Upgrade to the latest patch release of {% data variables.product.prodname_ghe_server %}. For more information, see "[AUTOTITLE](/admin/enterprise-management/updating-the-virtual-machine-and-physical-resources/upgrading-github-enterprise-server)." diff --git a/content/admin/enterprise-management/updating-the-virtual-machine-and-physical-resources/upgrading-github-enterprise-server.md b/content/admin/enterprise-management/updating-the-virtual-machine-and-physical-resources/upgrading-github-enterprise-server.md index 9a29d0e26adc..4c64ed742c01 100644 --- a/content/admin/enterprise-management/updating-the-virtual-machine-and-physical-resources/upgrading-github-enterprise-server.md +++ b/content/admin/enterprise-management/updating-the-virtual-machine-and-physical-resources/upgrading-github-enterprise-server.md @@ -145,10 +145,10 @@ If the upgrade target you're presented with is a feature release instead of a pa 1. {% data reusables.enterprise_installation.enterprise-download-upgrade-pkg %} Copy the URL for the upgrade hotpackage (*.hpkg* file). {% data reusables.enterprise_installation.download-package %} 1. Run the `ghe-upgrade` command using the package file name: - ```shell - admin@HOSTNAME:~$ ghe-upgrade GITHUB-UPGRADE.hpkg - *** verifying upgrade package signature... - ``` + ```shell + admin@HOSTNAME:~$ ghe-upgrade GITHUB-UPGRADE.hpkg + *** verifying upgrade package signature... + ``` 1. If at least one service or system component requires a reboot, the hotpatch upgrade script notifies you. For example, updates to the kernel, MySQL, or Elasticsearch may require a reboot. ### Upgrading an instance with multiple nodes using a hotpatch @@ -194,18 +194,18 @@ While you can use a hotpatch to upgrade to the latest patch release within a fea {% endnote %} 1. Run the `ghe-upgrade` command using the package file name: - ```shell - admin@HOSTNAME:~$ ghe-upgrade GITHUB-UPGRADE.pkg - *** verifying upgrade package signature... - ``` + ```shell + admin@HOSTNAME:~$ ghe-upgrade GITHUB-UPGRADE.pkg + *** verifying upgrade package signature... + ``` 1. Confirm that you'd like to continue with the upgrade and restart after the package signature verifies. The new root filesystem writes to the secondary partition and the instance automatically restarts in maintenance mode: - ```shell - *** applying update... - This package will upgrade your installation to version VERSION-NUMBER - Current root partition: /dev/xvda1 [VERSION-NUMBER] - Target root partition: /dev/xvda2 - Proceed with installation? [y/N] - ``` + ```shell + *** applying update... + This package will upgrade your installation to version VERSION-NUMBER + Current root partition: /dev/xvda1 [VERSION-NUMBER] + Target root partition: /dev/xvda2 + Proceed with installation? [y/N] + ``` 1. After the instance restarts, the upgrade will continue in the background. You cannot unset maintenance mode until the process completes. To monitor progress, read the output in `/data/user/common/ghe-config.log`. For example, you can tail the log by running the following command: ```shell diff --git a/content/admin/installation/setting-up-a-github-enterprise-server-instance/installing-github-enterprise-server-on-aws.md b/content/admin/installation/setting-up-a-github-enterprise-server-instance/installing-github-enterprise-server-on-aws.md index 0c9c25378619..0143fa90e97d 100644 --- a/content/admin/installation/setting-up-a-github-enterprise-server-instance/installing-github-enterprise-server-on-aws.md +++ b/content/admin/installation/setting-up-a-github-enterprise-server-instance/installing-github-enterprise-server-on-aws.md @@ -68,12 +68,12 @@ AMIs for {% data variables.product.prodname_ghe_server %} are available in the A ### Using the AWS CLI to select an AMI 1. Using the AWS CLI, get a list of {% data variables.product.prodname_ghe_server %} images published by {% data variables.product.prodname_dotcom %}'s AWS owner IDs (`025577942450` for GovCloud, and `895557238572` for other regions). For more information, see "[describe-images](https://docs.aws.amazon.com/cli/latest/reference/ec2/describe-images.html)" in the AWS documentation. - ```shell - aws ec2 describe-images \ - --owners OWNER_ID \ - --query 'sort_by(Images,&Name)[*].{Name:Name,ImageID:ImageId}' \ - --output=text - ``` + ```shell + aws ec2 describe-images \ + --owners OWNER_ID \ + --query 'sort_by(Images,&Name)[*].{Name:Name,ImageID:ImageId}' \ + --output=text + ``` 2. Take note of the AMI ID for the latest {% data variables.product.prodname_ghe_server %} image. ## Creating a security group @@ -81,16 +81,16 @@ AMIs for {% data variables.product.prodname_ghe_server %} are available in the A If you're setting up your AMI for the first time, you will need to create a security group and add a new security group rule for each port in the table below. For more information, see the AWS guide "[Using Security Groups](https://docs.aws.amazon.com/cli/latest/userguide/cli-ec2-sg.html)." 1. Using the AWS CLI, create a new security group. For more information, see "[create-security-group](https://docs.aws.amazon.com/cli/latest/reference/ec2/create-security-group.html)" in the AWS documentation. - ```shell - $ aws ec2 create-security-group --group-name SECURITY_GROUP_NAME --description "SECURITY GROUP DESCRIPTION" - ``` + ```shell + $ aws ec2 create-security-group --group-name SECURITY_GROUP_NAME --description "SECURITY GROUP DESCRIPTION" + ``` 2. Take note of the security group ID (`sg-xxxxxxxx`) of your newly created security group. 3. Create a security group rule for each of the ports in the table below. For more information, see "[authorize-security-group-ingress](https://docs.aws.amazon.com/cli/latest/reference/ec2/authorize-security-group-ingress.html)" in the AWS documentation. - ```shell - $ aws ec2 authorize-security-group-ingress --group-id SECURITY_GROUP_ID --protocol PROTOCOL --port PORT_NUMBER --cidr SOURCE IP RANGE - ``` + ```shell + $ aws ec2 authorize-security-group-ingress --group-id SECURITY_GROUP_ID --protocol PROTOCOL --port PORT_NUMBER --cidr SOURCE IP RANGE + ``` This table identifies what each port is used for. {% data reusables.enterprise_installation.necessary_ports %} diff --git a/content/admin/installation/setting-up-a-github-enterprise-server-instance/installing-github-enterprise-server-on-azure.md b/content/admin/installation/setting-up-a-github-enterprise-server-instance/installing-github-enterprise-server-on-azure.md index 16f9daa87138..ec5cfe52e401 100644 --- a/content/admin/installation/setting-up-a-github-enterprise-server-instance/installing-github-enterprise-server-on-azure.md +++ b/content/admin/installation/setting-up-a-github-enterprise-server-instance/installing-github-enterprise-server-on-azure.md @@ -41,9 +41,9 @@ Before launching {% data variables.location.product_location %} on Azure, you'll {% data reusables.enterprise_installation.create-ghe-instance %} 1. Find the most recent {% data variables.product.prodname_ghe_server %} appliance image. For more information about the `vm image list` command, see "[`az vm image list`](https://docs.microsoft.com/cli/azure/vm/image?view=azure-cli-latest#az_vm_image_list)" in the Microsoft documentation. - ```shell - $ az vm image list --all -f GitHub-Enterprise | grep '"urn":' | sort -V - ``` + ```shell + $ az vm image list --all -f GitHub-Enterprise | grep '"urn":' | sort -V + ``` 2. Create a new VM using the appliance image you found. For more information, see "[`az vm create`](https://docs.microsoft.com/cli/azure/vm?view=azure-cli-latest#az_vm_create)" in the Microsoft documentation. @@ -84,24 +84,24 @@ To configure the instance, you must confirm the instance's status, upload a lice {% data reusables.enterprise_installation.new-instance-attack-vector-warning %} 1. Before configuring the VM, you must wait for it to enter ReadyRole status. Check the status of the VM with the `vm list` command. For more information, see "[`az vm list`](https://docs.microsoft.com/cli/azure/vm?view=azure-cli-latest#az_vm_list)" in the Microsoft documentation. - ```shell - $ az vm list -d -g RESOURCE_GROUP -o table - > Name ResourceGroup PowerState PublicIps Fqdns Location Zones - > ------ --------------- ------------ ------------ ------- ---------- ------- - > VM_NAME RESOURCE_GROUP VM running 40.76.79.202 eastus + ```shell + $ az vm list -d -g RESOURCE_GROUP -o table + > Name ResourceGroup PowerState PublicIps Fqdns Location Zones + > ------ --------------- ------------ ------------ ------- ---------- ------- + > VM_NAME RESOURCE_GROUP VM running 40.76.79.202 eastus - ``` - {% note %} + ``` + {% note %} - **Note:** Azure does not automatically create a FQDNS entry for the VM. For more information, see Azure's guide on how to "[Create a fully qualified domain name in the Azure portal for a Linux VM](https://docs.microsoft.com/azure/virtual-machines/linux/portal-create-fqdn)." + **Note:** Azure does not automatically create a FQDNS entry for the VM. For more information, see Azure's guide on how to "[Create a fully qualified domain name in the Azure portal for a Linux VM](https://docs.microsoft.com/azure/virtual-machines/linux/portal-create-fqdn)." - {% endnote %} + {% endnote %} - {% data reusables.enterprise_installation.copy-the-vm-public-dns-name %} - {% data reusables.enterprise_installation.upload-a-license-file %} - {% data reusables.enterprise_installation.save-settings-in-web-based-mgmt-console %} For more information, see "[AUTOTITLE](/admin/configuration/configuring-your-enterprise)." - {% data reusables.enterprise_installation.instance-will-restart-automatically %} - {% data reusables.enterprise_installation.visit-your-instance %} + {% data reusables.enterprise_installation.copy-the-vm-public-dns-name %} + {% data reusables.enterprise_installation.upload-a-license-file %} + {% data reusables.enterprise_installation.save-settings-in-web-based-mgmt-console %} For more information, see "[AUTOTITLE](/admin/configuration/configuring-your-enterprise)." + {% data reusables.enterprise_installation.instance-will-restart-automatically %} + {% data reusables.enterprise_installation.visit-your-instance %} ## Azure extension features diff --git a/content/admin/installation/setting-up-a-github-enterprise-server-instance/installing-github-enterprise-server-on-hyper-v.md b/content/admin/installation/setting-up-a-github-enterprise-server-instance/installing-github-enterprise-server-on-hyper-v.md index 55a4b8314bb7..0a72a2ab8020 100644 --- a/content/admin/installation/setting-up-a-github-enterprise-server-instance/installing-github-enterprise-server-on-hyper-v.md +++ b/content/admin/installation/setting-up-a-github-enterprise-server-instance/installing-github-enterprise-server-on-hyper-v.md @@ -37,25 +37,25 @@ shortTitle: Install on Hyper-V {% data reusables.enterprise_installation.create-ghe-instance %} 1. In PowerShell, create a new Generation 1 virtual machine, configure the size based on your user license count, and attach the {% data variables.product.prodname_ghe_server %} image you downloaded. For more information, see "[New-VM](https://docs.microsoft.com/powershell/module/hyper-v/new-vm?view=win10-ps)" in the Microsoft documentation. - ```shell - PS C:\> New-VM -Generation 1 -Name VM_NAME -MemoryStartupBytes MEMORY_SIZE -BootDevice VHD -VHDPath PATH_TO_VHD - ``` + ```shell + PS C:\> New-VM -Generation 1 -Name VM_NAME -MemoryStartupBytes MEMORY_SIZE -BootDevice VHD -VHDPath PATH_TO_VHD + ``` {% data reusables.enterprise_installation.create-attached-storage-volume %} Replace `PATH_TO_DATA_DISK` with the path to the location where you create the disk. For more information, see "[New-VHD](https://docs.microsoft.com/powershell/module/hyper-v/new-vhd?view=win10-ps)" in the Microsoft documentation. - ```shell - PS C:\> New-VHD -Path PATH_TO_DATA_DISK -SizeBytes DISK_SIZE - ``` + ```shell + PS C:\> New-VHD -Path PATH_TO_DATA_DISK -SizeBytes DISK_SIZE + ``` 3. Attach the data disk to your instance. For more information, see "[Add-VMHardDiskDrive](https://docs.microsoft.com/powershell/module/hyper-v/add-vmharddiskdrive?view=win10-ps)" in the Microsoft documentation. - ```shell - PS C:\> Add-VMHardDiskDrive -VMName VM_NAME -Path PATH_TO_DATA_DISK - ``` + ```shell + PS C:\> Add-VMHardDiskDrive -VMName VM_NAME -Path PATH_TO_DATA_DISK + ``` 4. Start the VM. For more information, see "[Start-VM](https://docs.microsoft.com/powershell/module/hyper-v/start-vm?view=win10-ps)" in the Microsoft documentation. - ```shell - PS C:\> Start-VM -Name VM_NAME - ``` + ```shell + PS C:\> Start-VM -Name VM_NAME + ``` 5. Get the IP address of your VM. For more information, see "[Get-VMNetworkAdapter](https://docs.microsoft.com/powershell/module/hyper-v/get-vmnetworkadapter?view=win10-ps)" in the Microsoft documentation. - ```shell - PS C:\> (Get-VMNetworkAdapter -VMName VM_NAME).IpAddresses - ``` + ```shell + PS C:\> (Get-VMNetworkAdapter -VMName VM_NAME).IpAddresses + ``` 6. Copy the VM's IP address and paste it into a web browser. ## Configuring the {% data variables.product.prodname_ghe_server %} instance diff --git a/content/admin/monitoring-activity-in-your-enterprise/exploring-user-activity/viewing-push-logs.md b/content/admin/monitoring-activity-in-your-enterprise/exploring-user-activity/viewing-push-logs.md index 6c923cb679f3..dae49c04bc3c 100644 --- a/content/admin/monitoring-activity-in-your-enterprise/exploring-user-activity/viewing-push-logs.md +++ b/content/admin/monitoring-activity-in-your-enterprise/exploring-user-activity/viewing-push-logs.md @@ -45,7 +45,7 @@ For more information, see "[Using the activity view to see changes to your repos {% data reusables.enterprise_installation.ssh-into-instance %} 1. In the appropriate Git repository, open the audit log file: - ```shell - ghe-repo OWNER/REPOSITORY -c "cat audit_log" - ``` + ```shell + ghe-repo OWNER/REPOSITORY -c "cat audit_log" + ``` {% endif %} diff --git a/content/admin/user-management/managing-repositories-in-your-enterprise/configuring-git-large-file-storage-for-your-enterprise.md b/content/admin/user-management/managing-repositories-in-your-enterprise/configuring-git-large-file-storage-for-your-enterprise.md index badb83e11fe2..927c84f46df2 100644 --- a/content/admin/user-management/managing-repositories-in-your-enterprise/configuring-git-large-file-storage-for-your-enterprise.md +++ b/content/admin/user-management/managing-repositories-in-your-enterprise/configuring-git-large-file-storage-for-your-enterprise.md @@ -75,33 +75,33 @@ For more information, see "[AUTOTITLE](/repositories/working-with-files/managing 1. Disable {% data variables.large_files.product_name_short %} on {% data variables.location.product_location %}. For more information, see "[Configuring {% data variables.large_files.product_name_long %} for your enterprise](#configuring-git-large-file-storage-for-your-enterprise)." 2. Create a {% data variables.large_files.product_name_short %} configuration file that points to the third party server. - ```shell - # Show default configuration - $ git lfs env - > git-lfs/1.1.0 (GitHub; darwin amd64; go 1.5.1; git 94d356c) - > git version 2.7.4 (Apple Git-66) -   - > Endpoint=https://GITHUB-ENTERPRISE-HOST/path/to/repo/info/lfs (auth=basic) -   - # Create .lfsconfig that points to third party server. - $ git config -f .lfsconfig remote.origin.lfsurl https://THIRD-PARTY-LFS-SERVER/path/to/repo - $ git lfs env - > git-lfs/1.1.0 (GitHub; darwin amd64; go 1.5.1; git 94d356c) - > git version 2.7.4 (Apple Git-66) -   - > Endpoint=https://THIRD-PARTY-LFS-SERVER/path/to/repo/info/lfs (auth=none) -   - # Show the contents of .lfsconfig - $ cat .lfsconfig - [remote "origin"] - lfsurl = https://THIRD-PARTY-LFS-SERVER/path/to/repo - ``` + ```shell + # Show default configuration + $ git lfs env + > git-lfs/1.1.0 (GitHub; darwin amd64; go 1.5.1; git 94d356c) + > git version 2.7.4 (Apple Git-66) +   + > Endpoint=https://GITHUB-ENTERPRISE-HOST/path/to/repo/info/lfs (auth=basic) +   + # Create .lfsconfig that points to third party server. + $ git config -f .lfsconfig remote.origin.lfsurl https://THIRD-PARTY-LFS-SERVER/path/to/repo + $ git lfs env + > git-lfs/1.1.0 (GitHub; darwin amd64; go 1.5.1; git 94d356c) + > git version 2.7.4 (Apple Git-66) +   + > Endpoint=https://THIRD-PARTY-LFS-SERVER/path/to/repo/info/lfs (auth=none) +   + # Show the contents of .lfsconfig + $ cat .lfsconfig + [remote "origin"] + lfsurl = https://THIRD-PARTY-LFS-SERVER/path/to/repo + ``` 3. To keep the same {% data variables.large_files.product_name_short %} configuration for each user, commit a custom `.lfsconfig` file to the repository. - ```shell - $ git add .lfsconfig - $ git commit -m "Adding LFS config file" - ``` + ```shell + $ git add .lfsconfig + $ git commit -m "Adding LFS config file" + ``` 3. Migrate any existing {% data variables.large_files.product_name_short %} assets. For more information, see "[Migrating to a different {% data variables.large_files.product_name_long %} server](#migrating-to-a-different-git-large-file-storage-server)." ## Migrating to a different Git Large File Storage server @@ -109,34 +109,34 @@ For more information, see "[AUTOTITLE](/repositories/working-with-files/managing Before migrating to a different {% data variables.large_files.product_name_long %} server, you must configure {% data variables.large_files.product_name_short %} to use a third party server. For more information, see "[Configuring {% data variables.large_files.product_name_long %} to use a third party server](#configuring-git-large-file-storage-to-use-a-third-party-server)." 1. Configure the repository with a second remote. - ```shell - $ git remote add NEW-REMOTE https://NEW-REMOTE-HOSTNAME/path/to/repo -   - $ git lfs env - > git-lfs/1.1.0 (GitHub; darwin amd64; go 1.5.1; git 94d356c) - > git version 2.7.4 (Apple Git-66) -   - > Endpoint=https://GITHUB-ENTERPRISE-HOST/path/to/repo/info/lfs (auth=basic) - > Endpoint (NEW-REMOTE)=https://NEW-REMOTE-HOSTNAME/path/to/repo/info/lfs (auth=none) - ``` + ```shell + $ git remote add NEW-REMOTE https://NEW-REMOTE-HOSTNAME/path/to/repo +   + $ git lfs env + > git-lfs/1.1.0 (GitHub; darwin amd64; go 1.5.1; git 94d356c) + > git version 2.7.4 (Apple Git-66) +   + > Endpoint=https://GITHUB-ENTERPRISE-HOST/path/to/repo/info/lfs (auth=basic) + > Endpoint (NEW-REMOTE)=https://NEW-REMOTE-HOSTNAME/path/to/repo/info/lfs (auth=none) + ``` 2. Fetch all objects from the old remote. - ```shell - $ git lfs fetch origin --all - > Scanning for all objects ever referenced... - > ✔ 16 objects found - > Fetching objects... - > Git LFS: (16 of 16 files) 48.71 MB / 48.85 MB - ``` + ```shell + $ git lfs fetch origin --all + > Scanning for all objects ever referenced... + > ✔ 16 objects found + > Fetching objects... + > Git LFS: (16 of 16 files) 48.71 MB / 48.85 MB + ``` 3. Push all objects to the new remote. - ```shell - $ git lfs push NEW-REMOTE --all - > Scanning for all objects ever referenced... - > ✔ 16 objects found - > Pushing objects... - > Git LFS: (16 of 16 files) 48.00 MB / 48.85 MB, 879.10 KB skipped - ``` + ```shell + $ git lfs push NEW-REMOTE --all + > Scanning for all objects ever referenced... + > ✔ 16 objects found + > Pushing objects... + > Git LFS: (16 of 16 files) 48.00 MB / 48.85 MB, 879.10 KB skipped + ``` {% endif %} ## Further reading diff --git a/content/admin/user-management/managing-users-in-your-enterprise/promoting-or-demoting-a-site-administrator.md b/content/admin/user-management/managing-users-in-your-enterprise/promoting-or-demoting-a-site-administrator.md index 9f3844f44a3b..c1e993306192 100644 --- a/content/admin/user-management/managing-users-in-your-enterprise/promoting-or-demoting-a-site-administrator.md +++ b/content/admin/user-management/managing-users-in-your-enterprise/promoting-or-demoting-a-site-administrator.md @@ -50,14 +50,14 @@ For information about promoting a user to an organization owner, see the `ghe-or 1. [SSH](/admin/configuration/configuring-your-enterprise/accessing-the-administrative-shell-ssh) into your appliance. 2. Run [ghe-user-promote](/admin/configuration/configuring-your-enterprise/command-line-utilities#ghe-user-promote) with the username to promote. - ```shell - $ ghe-user-promote USERNAME - ``` + ```shell + $ ghe-user-promote USERNAME + ``` ## Demoting a site administrator from the command line 1. [SSH](/admin/configuration/configuring-your-enterprise/accessing-the-administrative-shell-ssh) into your appliance. 2. Run [ghe-user-demote](/admin/configuration/configuring-your-enterprise/command-line-utilities#ghe-user-demote) with the username to demote. - ```shell - $ ghe-user-demote USERNAME - ``` + ```shell + $ ghe-user-demote USERNAME + ``` diff --git a/content/admin/user-management/managing-users-in-your-enterprise/suspending-and-unsuspending-users.md b/content/admin/user-management/managing-users-in-your-enterprise/suspending-and-unsuspending-users.md index fd2e1ddf2256..f5b428ea913b 100644 --- a/content/admin/user-management/managing-users-in-your-enterprise/suspending-and-unsuspending-users.md +++ b/content/admin/user-management/managing-users-in-your-enterprise/suspending-and-unsuspending-users.md @@ -64,9 +64,9 @@ As when suspending a user, unsuspending a user takes effect immediately. The use {% data reusables.enterprise_installation.ssh-into-instance %} 2. Run [ghe-user-suspend](/admin/configuration/configuring-your-enterprise/command-line-utilities#ghe-user-suspend) with the username to suspend. - ```shell - $ ghe-user-suspend USERNAME - ``` + ```shell + $ ghe-user-suspend USERNAME + ``` ## Creating a custom message for suspended users @@ -86,9 +86,9 @@ You can create a custom message that suspended users will see when attempting to {% data reusables.enterprise_installation.ssh-into-instance %} 2. Run [ghe-user-unsuspend](/admin/configuration/configuring-your-enterprise/command-line-utilities#ghe-user-unsuspend) with the username to unsuspend. - ```shell - $ ghe-user-unsuspend USERNAME - ``` + ```shell + $ ghe-user-unsuspend USERNAME + ``` ## Further reading - "[AUTOTITLE](/rest/enterprise-admin#suspend-a-user)" diff --git a/content/apps/creating-github-apps/guides/creating-ci-tests-with-the-checks-api.md b/content/apps/creating-github-apps/guides/creating-ci-tests-with-the-checks-api.md index 9bccb77dc527..6b5314c3d921 100644 --- a/content/apps/creating-github-apps/guides/creating-ci-tests-with-the-checks-api.md +++ b/content/apps/creating-github-apps/guides/creating-ci-tests-with-the-checks-api.md @@ -56,9 +56,9 @@ You'll use the [Ruby programming language](https://www.ruby-lang.org/en/), the [ You don't need to be an expert in any of these tools or concepts to complete this project. This guide will walk you through all the required steps. Before you begin creating CI tests with the Checks API, you'll need to do the following: 1. Clone the [Creating CI tests with the Checks API](https://github.com/github-developer/creating-ci-tests-with-the-checks-api) repository. - ```shell - $ git clone https://github.com/github-developer/creating-ci-tests-with-the-checks-api.git - ``` + ```shell + $ git clone https://github.com/github-developer/creating-ci-tests-with-the-checks-api.git + ``` Inside the directory, you'll find a `template_server.rb` file with the template code you'll use in this quickstart and a `server.rb` file with the completed project code. diff --git a/content/apps/creating-github-apps/guides/using-the-github-api-in-your-app.md b/content/apps/creating-github-apps/guides/using-the-github-api-in-your-app.md index 4a93c79c7a90..606e0490650f 100644 --- a/content/apps/creating-github-apps/guides/using-the-github-api-in-your-app.md +++ b/content/apps/creating-github-apps/guides/using-the-github-api-in-your-app.md @@ -43,9 +43,9 @@ But you can follow along at any experience level. We'll link out to information Before you begin, you'll need to do the following: 1. Clone the [Using the GitHub API in your app](https://github.com/github-developer/using-the-github-api-in-your-app) repository. - ```shell - $ git clone https://github.com/github-developer/using-the-github-api-in-your-app.git - ``` + ```shell + $ git clone https://github.com/github-developer/using-the-github-api-in-your-app.git + ``` Inside the directory, you'll find a `template_server.rb` file with the template code you'll use in this quickstart and a `server.rb` file with the completed project code. diff --git a/content/authentication/connecting-to-github-with-ssh/testing-your-ssh-connection.md b/content/authentication/connecting-to-github-with-ssh/testing-your-ssh-connection.md index f7d7cec61e3b..2430cc3cd1e1 100644 --- a/content/authentication/connecting-to-github-with-ssh/testing-your-ssh-connection.md +++ b/content/authentication/connecting-to-github-with-ssh/testing-your-ssh-connection.md @@ -23,10 +23,10 @@ When you test your connection, you'll need to authenticate this action using you {% data reusables.command_line.open_the_multi_os_terminal %} 2. Enter the following: - ```shell - $ ssh -T git@{% data variables.command_line.codeblock %} - # Attempts to ssh to {% data variables.product.product_name %} - ``` + ```shell + $ ssh -T git@{% data variables.command_line.codeblock %} + # Attempts to ssh to {% data variables.product.product_name %} + ``` You may see a warning like this: @@ -37,24 +37,24 @@ When you test your connection, you'll need to authenticate this action using you ``` 3. Verify that the fingerprint in the message you see matches {% ifversion fpt or ghec %}[{% data variables.product.prodname_dotcom %}'s public key fingerprint](/authentication/keeping-your-account-and-data-secure/githubs-ssh-key-fingerprints){% else %} your enterprise's public key fingerprint{% endif %}. If it does, then type `yes`: - ```shell - > Hi USERNAME! You've successfully authenticated, but GitHub does not - > provide shell access. - ``` + ```shell + > Hi USERNAME! You've successfully authenticated, but GitHub does not + > provide shell access. + ``` - {% linux %} + {% linux %} - You may see this error message: - ```shell - ... - Agent admitted failure to sign using the key. - debug1: No more authentication methods to try. - Permission denied (publickey). - ``` + You may see this error message: + ```shell + ... + Agent admitted failure to sign using the key. + debug1: No more authentication methods to try. + Permission denied (publickey). + ``` - This is a known problem with certain Linux distributions. For more information, see "[AUTOTITLE](/authentication/troubleshooting-ssh/error-agent-admitted-failure-to-sign)." + This is a known problem with certain Linux distributions. For more information, see "[AUTOTITLE](/authentication/troubleshooting-ssh/error-agent-admitted-failure-to-sign)." - {% endlinux %} + {% endlinux %} {% note %} diff --git a/content/authentication/keeping-your-account-and-data-secure/about-anonymized-urls.md b/content/authentication/keeping-your-account-and-data-secure/about-anonymized-urls.md index 23e2375a3b19..0c100a112b1d 100644 --- a/content/authentication/keeping-your-account-and-data-secure/about-anonymized-urls.md +++ b/content/authentication/keeping-your-account-and-data-secure/about-anonymized-urls.md @@ -40,15 +40,15 @@ If an image is showing up in your browser but not on {% data variables.product.p {% data reusables.command_line.open_the_multi_os_terminal %} 1. Request the image headers using `curl`. - ```shell - $ curl -I https://www.my-server.com/images/some-image.png - > HTTP/2 200 - > Date: Fri, 06 Jun 2014 07:27:43 GMT - > Expires: Sun, 06 Jul 2014 07:27:43 GMT - > Content-Type: image/x-png - > Server: Google Frontend - > Content-Length: 6507 - ``` + ```shell + $ curl -I https://www.my-server.com/images/some-image.png + > HTTP/2 200 + > Date: Fri, 06 Jun 2014 07:27:43 GMT + > Expires: Sun, 06 Jul 2014 07:27:43 GMT + > Content-Type: image/x-png + > Server: Google Frontend + > Content-Length: 6507 + ``` 3. Check the value of `Content-Type`. In this case, it's `image/x-png`. 4. Check that content type against [the list of types supported by Camo](https://github.com/atmos/camo/blob/master/mime-types.json). @@ -63,14 +63,14 @@ If you changed an image recently and it's showing up in your browser but not {% {% data reusables.command_line.open_the_multi_os_terminal %} 1. Request the image headers using `curl`. - ```shell - $ curl -I https://www.my-server.com/images/some-image.png - > HTTP/2 200 - > Expires: Fri, 01 Jan 1984 00:00:00 GMT - > Content-Type: image/png - > Content-Length: 2339 - > Server: Jetty(8.y.z-SNAPSHOT) - ``` + ```shell + $ curl -I https://www.my-server.com/images/some-image.png + > HTTP/2 200 + > Expires: Fri, 01 Jan 1984 00:00:00 GMT + > Content-Type: image/png + > Content-Length: 2339 + > Server: Jetty(8.y.z-SNAPSHOT) + ``` Check the value of `Cache-Control`. In this example, there's no `Cache-Control`. In that case: * If you own the server that's hosting the image, modify it so that it returns a `Cache-Control` of `no-cache` for images. @@ -84,10 +84,10 @@ Purging the cache forces every {% data variables.product.prodname_dotcom %} user {% data reusables.command_line.open_the_multi_os_terminal %} 1. Purge the image using `curl -X PURGE` on the Camo URL. - ```shell - $ curl -X PURGE https://camo.githubusercontent.com/4d04abe0044d94fefcf9af2133223.... - > {"status": "ok", "id": "216-8675309-1008701"} - ``` + ```shell + $ curl -X PURGE https://camo.githubusercontent.com/4d04abe0044d94fefcf9af2133223.... + > {"status": "ok", "id": "216-8675309-1008701"} + ``` ### Viewing images on private networks diff --git a/content/authentication/keeping-your-account-and-data-secure/removing-sensitive-data-from-a-repository.md b/content/authentication/keeping-your-account-and-data-secure/removing-sensitive-data-from-a-repository.md index becc69a18d7a..2d91ab6a7803 100644 --- a/content/authentication/keeping-your-account-and-data-secure/removing-sensitive-data-from-a-repository.md +++ b/content/authentication/keeping-your-account-and-data-secure/removing-sensitive-data-from-a-repository.md @@ -79,31 +79,31 @@ See the [BFG Repo-Cleaner](https://rtyley.github.io/bfg-repo-cleaner/)'s documen To illustrate how `git filter-repo` works, we'll show you how to remove your file with sensitive data from the history of your repository and add it to `.gitignore` to ensure that it is not accidentally re-committed. 1. Install the latest release of the [git filter-repo](https://github.com/newren/git-filter-repo) tool. You can install `git-filter-repo` manually or by using a package manager. For example, to install the tool with HomeBrew, use the `brew install` command. - ``` - brew install git-filter-repo - ``` + ``` + brew install git-filter-repo + ``` For more information, see [*INSTALL.md*](https://github.com/newren/git-filter-repo/blob/main/INSTALL.md) in the `newren/git-filter-repo` repository. 2. If you don't already have a local copy of your repository with sensitive data in its history, [clone the repository](/repositories/creating-and-managing-repositories/cloning-a-repository) to your local computer. - ```shell - $ git clone https://{% data variables.command_line.codeblock %}/YOUR-USERNAME/YOUR-REPOSITORY - > Initialized empty Git repository in /Users/YOUR-FILE-PATH/YOUR-REPOSITORY/.git/ - > remote: Counting objects: 1301, done. - > remote: Compressing objects: 100% (769/769), done. - > remote: Total 1301 (delta 724), reused 910 (delta 522) - > Receiving objects: 100% (1301/1301), 164.39 KiB, done. - > Resolving deltas: 100% (724/724), done. - ``` + ```shell + $ git clone https://{% data variables.command_line.codeblock %}/YOUR-USERNAME/YOUR-REPOSITORY + > Initialized empty Git repository in /Users/YOUR-FILE-PATH/YOUR-REPOSITORY/.git/ + > remote: Counting objects: 1301, done. + > remote: Compressing objects: 100% (769/769), done. + > remote: Total 1301 (delta 724), reused 910 (delta 522) + > Receiving objects: 100% (1301/1301), 164.39 KiB, done. + > Resolving deltas: 100% (724/724), done. + ``` 3. Navigate into the repository's working directory. - ```shell - $ cd YOUR-REPOSITORY - ``` + ```shell + $ cd YOUR-REPOSITORY + ``` 4. Run the following command, replacing `PATH-TO-YOUR-FILE-WITH-SENSITIVE-DATA` with the **path to the file you want to remove, not just its filename**. These arguments will: - Force Git to process, but not check out, the entire history of every branch and tag - Remove the specified file, as well as any empty commits generated as a result - Remove some configurations, such as the remote URL, stored in the *.git/config* file. You may want to back up this file in advance for restoration later. - **Overwrite your existing tags** - ```shell + ```shell $ git filter-repo --invert-paths --path PATH-TO-YOUR-FILE-WITH-SENSITIVE-DATA Parsed 197 commits New history written in 0.11 seconds; now repacking/cleaning... @@ -126,36 +126,36 @@ To illustrate how `git filter-repo` works, we'll show you how to remove your fil 5. Add your file with sensitive data to `.gitignore` to ensure that you don't accidentally commit it again. - ```shell - $ echo "YOUR-FILE-WITH-SENSITIVE-DATA" >> .gitignore - $ git add .gitignore - $ git commit -m "Add YOUR-FILE-WITH-SENSITIVE-DATA to .gitignore" - > [main 051452f] Add YOUR-FILE-WITH-SENSITIVE-DATA to .gitignore - > 1 files changed, 1 insertions(+), 0 deletions(-) - ``` + ```shell + $ echo "YOUR-FILE-WITH-SENSITIVE-DATA" >> .gitignore + $ git add .gitignore + $ git commit -m "Add YOUR-FILE-WITH-SENSITIVE-DATA to .gitignore" + > [main 051452f] Add YOUR-FILE-WITH-SENSITIVE-DATA to .gitignore + > 1 files changed, 1 insertions(+), 0 deletions(-) + ``` 6. Double-check that you've removed everything you wanted to from your repository's history, and that all of your branches are checked out. 7. Once you're happy with the state of your repository, force-push your local changes to overwrite your repository on {% ifversion ghae %}{% data variables.product.product_name %}{% else %}{% data variables.location.product_location %}{% endif %}, as well as all the branches you've pushed up. A force push is required to remove sensitive data from your commit history. - ```shell - $ git push origin --force --all - > Counting objects: 1074, done. - > Delta compression using 2 threads. - > Compressing objects: 100% (677/677), done. - > Writing objects: 100% (1058/1058), 148.85 KiB, done. - > Total 1058 (delta 590), reused 602 (delta 378) - > To https://{% data variables.command_line.codeblock %}/YOUR-USERNAME/YOUR-REPOSITORY.git - > + 48dc599...051452f main -> main (forced update) - ``` + ```shell + $ git push origin --force --all + > Counting objects: 1074, done. + > Delta compression using 2 threads. + > Compressing objects: 100% (677/677), done. + > Writing objects: 100% (1058/1058), 148.85 KiB, done. + > Total 1058 (delta 590), reused 602 (delta 378) + > To https://{% data variables.command_line.codeblock %}/YOUR-USERNAME/YOUR-REPOSITORY.git + > + 48dc599...051452f main -> main (forced update) + ``` 8. In order to remove the sensitive file from [your tagged releases](/repositories/releasing-projects-on-github/about-releases), you'll also need to force-push against your Git tags: - ```shell - $ git push origin --force --tags - > Counting objects: 321, done. - > Delta compression using up to 8 threads. - > Compressing objects: 100% (166/166), done. - > Writing objects: 100% (321/321), 331.74 KiB | 0 bytes/s, done. - > Total 321 (delta 124), reused 269 (delta 108) - > To https://{% data variables.command_line.codeblock %}/YOUR-USERNAME/YOUR-REPOSITORY.git - > + 48dc599...051452f main -> main (forced update) - ``` + ```shell + $ git push origin --force --tags + > Counting objects: 321, done. + > Delta compression using up to 8 threads. + > Compressing objects: 100% (166/166), done. + > Writing objects: 100% (321/321), 331.74 KiB | 0 bytes/s, done. + > Total 321 (delta 124), reused 269 (delta 108) + > To https://{% data variables.command_line.codeblock %}/YOUR-USERNAME/YOUR-REPOSITORY.git + > + 48dc599...051452f main -> main (forced update) + ``` ## Fully removing the data from {% data variables.product.prodname_dotcom %} @@ -166,21 +166,21 @@ After using either the BFG tool or `git filter-repo` to remove the sensitive dat 2. Tell your collaborators to [rebase](https://git-scm.com/book/en/Git-Branching-Rebasing), *not* merge, any branches they created off of your old (tainted) repository history. One merge commit could reintroduce some or all of the tainted history that you just went to the trouble of purging. 3. After some time has passed and you're confident that the BFG tool / `git filter-repo` had no unintended side effects, you can force all objects in your local repository to be dereferenced and garbage collected with the following commands (using Git 1.8.5 or newer): - ```shell - $ git for-each-ref --format="delete %(refname)" refs/original | git update-ref --stdin - $ git reflog expire --expire=now --all - $ git gc --prune=now - > Counting objects: 2437, done. - > Delta compression using up to 4 threads. - > Compressing objects: 100% (1378/1378), done. - > Writing objects: 100% (2437/2437), done. - > Total 2437 (delta 1461), reused 1802 (delta 1048) - ``` - {% note %} + ```shell + $ git for-each-ref --format="delete %(refname)" refs/original | git update-ref --stdin + $ git reflog expire --expire=now --all + $ git gc --prune=now + > Counting objects: 2437, done. + > Delta compression using up to 4 threads. + > Compressing objects: 100% (1378/1378), done. + > Writing objects: 100% (2437/2437), done. + > Total 2437 (delta 1461), reused 1802 (delta 1048) + ``` + {% note %} **Note:** You can also achieve this by pushing your filtered history to a new or empty repository and then making a fresh clone from {% data variables.product.product_name %}. - {% endnote %} + {% endnote %} ## Avoiding accidental commits in the future diff --git a/content/authentication/keeping-your-account-and-data-secure/reviewing-your-ssh-keys.md b/content/authentication/keeping-your-account-and-data-secure/reviewing-your-ssh-keys.md index 3ab786a8abc8..62a9798a489c 100644 --- a/content/authentication/keeping-your-account-and-data-secure/reviewing-your-ssh-keys.md +++ b/content/authentication/keeping-your-account-and-data-secure/reviewing-your-ssh-keys.md @@ -35,10 +35,10 @@ You can delete unauthorized (or possibly compromised) SSH keys to ensure that an {% data reusables.command_line.start_ssh_agent %} 6. Find and take a note of your public key fingerprint. - ```shell - $ ssh-add -l -E sha256 - > 2048 SHA256:274ffWxgaxq/tSINAykStUL7XWyRNcRTlcST1Ei7gBQ /Users/USERNAME/.ssh/id_rsa (RSA) - ``` + ```shell + $ ssh-add -l -E sha256 + > 2048 SHA256:274ffWxgaxq/tSINAykStUL7XWyRNcRTlcST1Ei7gBQ /Users/USERNAME/.ssh/id_rsa (RSA) + ``` 7. The SSH keys on {% data variables.product.product_name %} *should* match the same keys on your computer. @@ -63,10 +63,10 @@ You can delete unauthorized (or possibly compromised) SSH keys to ensure that an {% data reusables.desktop.windows_git_for_windows_turn_on_ssh_agent %} 6. Find and take a note of your public key fingerprint. - ```shell - $ ssh-add -l -E sha256 - > 2048 SHA256:274ffWxgaxq/tSINAykStUL7XWyRNcRTlcST1Ei7gBQ /Users/USERNAME/.ssh/id_rsa (RSA) - ``` + ```shell + $ ssh-add -l -E sha256 + > 2048 SHA256:274ffWxgaxq/tSINAykStUL7XWyRNcRTlcST1Ei7gBQ /Users/USERNAME/.ssh/id_rsa (RSA) + ``` 7. The SSH keys on {% data variables.product.product_name %} *should* match the same keys on your computer. @@ -89,10 +89,10 @@ You can delete unauthorized (or possibly compromised) SSH keys to ensure that an {% data reusables.command_line.start_ssh_agent %} 6. Find and take a note of your public key fingerprint. - ```shell - $ ssh-add -l -E sha256 - > 2048 SHA256:274ffWxgaxq/tSINAykStUL7XWyRNcRTlcST1Ei7gBQ /Users/USERNAME/.ssh/id_rsa (RSA) - ``` + ```shell + $ ssh-add -l -E sha256 + > 2048 SHA256:274ffWxgaxq/tSINAykStUL7XWyRNcRTlcST1Ei7gBQ /Users/USERNAME/.ssh/id_rsa (RSA) + ``` 7. The SSH keys on {% data variables.product.product_name %} *should* match the same keys on your computer. diff --git a/content/authentication/managing-commit-signature-verification/associating-an-email-with-your-gpg-key.md b/content/authentication/managing-commit-signature-verification/associating-an-email-with-your-gpg-key.md index 5fe244645182..909e3d3da70a 100644 --- a/content/authentication/managing-commit-signature-verification/associating-an-email-with-your-gpg-key.md +++ b/content/authentication/managing-commit-signature-verification/associating-an-email-with-your-gpg-key.md @@ -25,31 +25,31 @@ If you're using a GPG key that matches your committer identity and your verified {% data reusables.gpg.list-keys-with-note %} {% data reusables.gpg.copy-gpg-key-id %} 4. Enter `gpg --edit-key GPG key ID`, substituting in the GPG key ID you'd like to use. In the following example, the GPG key ID is `3AA5C34371567BD2`: - ```shell - $ gpg --edit-key 3AA5C34371567BD2 - ``` + ```shell + $ gpg --edit-key 3AA5C34371567BD2 + ``` 5. Enter `gpg> adduid` to add the user ID details. - ```shell - $ gpg> adduid - ``` + ```shell + $ gpg> adduid + ``` 6. Follow the prompts to supply your real name, email address, and any comments. You can modify your entries by choosing `N`, `C`, or `E`. {% data reusables.gpg.private-email %} {% ifversion fpt or ghec %} For more information, see "[AUTOTITLE](/account-and-profile/setting-up-and-managing-your-personal-account-on-github/managing-email-preferences/setting-your-commit-email-address)."{% endif %} - ```shell - Real Name: OCTOCAT - Email address: "octocat@github.com" - Comment: GITHUB-KEY - Change (N)ame, (C)omment, (E)mail or (O)kay/(Q)uit? - ``` + ```shell + Real Name: OCTOCAT + Email address: "octocat@github.com" + Comment: GITHUB-KEY + Change (N)ame, (C)omment, (E)mail or (O)kay/(Q)uit? + ``` 7. Enter `O` to confirm your selections. 8. Enter your key's passphrase. 9. Enter `gpg> save` to save the changes - ```shell - $ gpg> save - ``` + ```shell + $ gpg> save + ``` 10. Enter `gpg --armor --export GPG key ID`, substituting in the GPG key ID you'd like to use. In the following example, the GPG key ID is `3AA5C34371567BD2`: - ```shell - $ gpg --armor --export 3AA5C34371567BD2 - # Prints the GPG key, in ASCII armor format - ``` + ```shell + $ gpg --armor --export 3AA5C34371567BD2 + # Prints the GPG key, in ASCII armor format + ``` 11. Upload the GPG key by [adding it to your GitHub account](/authentication/managing-commit-signature-verification/adding-a-gpg-key-to-your-github-account). ## Further reading diff --git a/content/authentication/managing-commit-signature-verification/signing-commits.md b/content/authentication/managing-commit-signature-verification/signing-commits.md index 9a1bb525c444..0c2988c6531e 100644 --- a/content/authentication/managing-commit-signature-verification/signing-commits.md +++ b/content/authentication/managing-commit-signature-verification/signing-commits.md @@ -35,16 +35,16 @@ You can also manually configure [gpg-agent](http://linux.die.net/man/1/gpg-agent If you have multiple keys or are attempting to sign commits or tags with a key that doesn't match your committer identity, you should [tell Git about your signing key](/authentication/managing-commit-signature-verification/telling-git-about-your-signing-key). 1. When committing changes in your local branch, add the -S flag to the git commit command: - ```shell - $ git commit -S -m "YOUR_COMMIT_MESSAGE" - # Creates a signed commit - ``` + ```shell + $ git commit -S -m "YOUR_COMMIT_MESSAGE" + # Creates a signed commit + ``` 2. If you're using GPG, after you create your commit, provide the passphrase you set up when you [generated your GPG key](/authentication/managing-commit-signature-verification/generating-a-new-gpg-key). 3. When you've finished creating commits locally, push them to your remote repository on {% data variables.product.product_name %}: - ```shell - $ git push - # Pushes your local commits to the remote repository - ``` + ```shell + $ git push + # Pushes your local commits to the remote repository + ``` 4. On {% data variables.product.product_name %}, navigate to your pull request. {% data reusables.repositories.review-pr-commits %} 5. To view more detailed information about the verified signature, click **Verified.** diff --git a/content/authentication/managing-commit-signature-verification/signing-tags.md b/content/authentication/managing-commit-signature-verification/signing-tags.md index 6462b770a2bd..c537db725633 100644 --- a/content/authentication/managing-commit-signature-verification/signing-tags.md +++ b/content/authentication/managing-commit-signature-verification/signing-tags.md @@ -18,15 +18,15 @@ topics: {% data reusables.gpg.desktop-support-for-commit-signing %} 1. To sign a tag, add `-s` to your `git tag` command. - ```shell - $ git tag -s MYTAG - # Creates a signed tag - ``` + ```shell + $ git tag -s MYTAG + # Creates a signed tag + ``` 2. Verify your signed tag by running `git tag -v [tag-name]`. - ```shell - $ git tag -v MYTAG - # Verifies the signed tag - ``` + ```shell + $ git tag -v MYTAG + # Verifies the signed tag + ``` ## Further reading diff --git a/content/authentication/managing-commit-signature-verification/telling-git-about-your-signing-key.md b/content/authentication/managing-commit-signature-verification/telling-git-about-your-signing-key.md index 5dbc6173bb72..ad915796f369 100644 --- a/content/authentication/managing-commit-signature-verification/telling-git-about-your-signing-key.md +++ b/content/authentication/managing-commit-signature-verification/telling-git-about-your-signing-key.md @@ -38,21 +38,21 @@ If you have multiple GPG keys, you need to tell Git which one to use. {% data reusables.gpg.paste-gpg-key-id %} {% data reusables.gpg.set-auto-sign %} 1. If you aren't using the GPG suite, run the following command in the `zsh` shell to add the GPG key to your `.zshrc` file, if it exists, or your `.zprofile` file: - ```shell - $ if [ -r ~/.zshrc ]; then echo 'export GPG_TTY=$(tty)' >> ~/.zshrc; \ - else echo 'export GPG_TTY=$(tty)' >> ~/.zprofile; fi - ``` - Alternatively, if you use the `bash` shell, run this command: - ```shell - $ if [ -r ~/.bash_profile ]; then echo 'export GPG_TTY=$(tty)' >> ~/.bash_profile; \ - else echo 'export GPG_TTY=$(tty)' >> ~/.profile; fi - ``` + ```shell + $ if [ -r ~/.zshrc ]; then echo 'export GPG_TTY=$(tty)' >> ~/.zshrc; \ + else echo 'export GPG_TTY=$(tty)' >> ~/.zprofile; fi + ``` + Alternatively, if you use the `bash` shell, run this command: + ```shell + $ if [ -r ~/.bash_profile ]; then echo 'export GPG_TTY=$(tty)' >> ~/.bash_profile; \ + else echo 'export GPG_TTY=$(tty)' >> ~/.profile; fi + ``` 1. Optionally, to prompt you to enter a PIN or passphrase when required, install `pinentry-mac`. For example, using [Homebrew](https://brew.sh/): - ```shell - $ brew install pinentry-mac - $ echo "pinentry-program $(which pinentry-mac)" >> ~/.gnupg/gpg-agent.conf - $ killall gpg-agent - ``` + ```shell + $ brew install pinentry-mac + $ echo "pinentry-program $(which pinentry-mac)" >> ~/.gnupg/gpg-agent.conf + $ killall gpg-agent + ``` {% endmac %} @@ -96,9 +96,9 @@ If you have multiple GPG keys, you need to tell Git which one to use. {% data reusables.gpg.paste-gpg-key-id %} {% data reusables.gpg.set-auto-sign %} 1. To add your GPG key to your `.bashrc` startup file, run the following command: - ```bash - $ [ -f ~/.bashrc ] && echo 'export GPG_TTY=$(tty)' >> ~/.bashrc - ``` + ```bash + $ [ -f ~/.bashrc ] && echo 'export GPG_TTY=$(tty)' >> ~/.bashrc + ``` {% endlinux %} {% ifversion ssh-commit-verification %} diff --git a/content/authentication/troubleshooting-ssh/error-permission-denied-publickey.md b/content/authentication/troubleshooting-ssh/error-permission-denied-publickey.md index 56791c8460a9..abaca801aa38 100644 --- a/content/authentication/troubleshooting-ssh/error-permission-denied-publickey.md +++ b/content/authentication/troubleshooting-ssh/error-permission-denied-publickey.md @@ -58,13 +58,13 @@ $ ssh -T git@{% data variables.command_line.codeblock %} {% data reusables.command_line.open_the_multi_os_terminal %} 2. Verify that you have a private key generated and loaded into SSH. - ```shell - # start the ssh-agent in the background - $ eval "$(ssh-agent -s)" - > Agent pid 59566 - $ ssh-add -l -E sha256 - > 2048 SHA256:274ffWxgaxq/tSINAykStUL7XWyRNcRTlcST1Ei7gBQ /Users/USERNAME/.ssh/id_rsa (RSA) - ``` + ```shell + # start the ssh-agent in the background + $ eval "$(ssh-agent -s)" + > Agent pid 59566 + $ ssh-add -l -E sha256 + > 2048 SHA256:274ffWxgaxq/tSINAykStUL7XWyRNcRTlcST1Ei7gBQ /Users/USERNAME/.ssh/id_rsa (RSA) + ``` {% endmac %} @@ -76,10 +76,10 @@ $ ssh -T git@{% data variables.command_line.codeblock %} {% data reusables.desktop.windows_git_for_windows_turn_on_ssh_agent %} 2. Verify that you have a private key generated and loaded into SSH. - ```shell - $ ssh-add -l -E sha256 - > 2048 SHA256:274ffWxgaxq/tSINAykStUL7XWyRNcRTlcST1Ei7gBQ /Users/USERNAME/.ssh/id_rsa (RSA) - ``` + ```shell + $ ssh-add -l -E sha256 + > 2048 SHA256:274ffWxgaxq/tSINAykStUL7XWyRNcRTlcST1Ei7gBQ /Users/USERNAME/.ssh/id_rsa (RSA) + ``` {% endwindows %} @@ -87,10 +87,10 @@ $ ssh -T git@{% data variables.command_line.codeblock %} {% data reusables.command_line.open_the_multi_os_terminal %} 2. Verify that you have a private key generated and loaded into SSH. - ```shell - $ ssh-add -l -E sha256 - > 2048 SHA256:274ffWxgaxq/tSINAykStUL7XWyRNcRTlcST1Ei7gBQ /Users/USERNAME/.ssh/id_rsa (RSA) - ``` + ```shell + $ ssh-add -l -E sha256 + > 2048 SHA256:274ffWxgaxq/tSINAykStUL7XWyRNcRTlcST1Ei7gBQ /Users/USERNAME/.ssh/id_rsa (RSA) + ``` {% endlinux %} @@ -143,15 +143,15 @@ You must provide your public key to {% data variables.product.product_name %} to 1. Open Terminal. 2. Start SSH agent in the background. - ```shell - $ eval "$(ssh-agent -s)" - > Agent pid 59566 - ``` + ```shell + $ eval "$(ssh-agent -s)" + > Agent pid 59566 + ``` 3. Find and take a note of your public key fingerprint. - ```shell - $ ssh-add -l -E sha256 - > 2048 SHA256:274ffWxgaxq/tSINAykStUL7XWyRNcRTlcST1Ei7gBQ /Users/USERNAME/.ssh/id_rsa (RSA) - ``` + ```shell + $ ssh-add -l -E sha256 + > 2048 SHA256:274ffWxgaxq/tSINAykStUL7XWyRNcRTlcST1Ei7gBQ /Users/USERNAME/.ssh/id_rsa (RSA) + ``` {% data reusables.user-settings.access_settings %} {% data reusables.user-settings.ssh %} @@ -163,15 +163,15 @@ You must provide your public key to {% data variables.product.product_name %} to 1. Open the command line. 2. Start SSH agent in the background. - ```shell - $ ssh-agent -s - > Agent pid 59566 - ``` + ```shell + $ ssh-agent -s + > Agent pid 59566 + ``` 3. Find and take a note of your public key fingerprint. - ```shell - $ ssh-add -l -E sha256 - > 2048 SHA256:274ffWxgaxq/tSINAykStUL7XWyRNcRTlcST1Ei7gBQ /Users/USERNAME/.ssh/id_rsa (RSA) - ``` + ```shell + $ ssh-add -l -E sha256 + > 2048 SHA256:274ffWxgaxq/tSINAykStUL7XWyRNcRTlcST1Ei7gBQ /Users/USERNAME/.ssh/id_rsa (RSA) + ``` {% data reusables.user-settings.access_settings %} {% data reusables.user-settings.ssh %} @@ -183,21 +183,21 @@ You must provide your public key to {% data variables.product.product_name %} to 1. Open Terminal. 2. Start SSH agent in the background. - ```shell - $ eval "$(ssh-agent -s)" - > Agent pid 59566 - ``` + ```shell + $ eval "$(ssh-agent -s)" + > Agent pid 59566 + ``` 3. Find and take a note of your public key fingerprint. If you're using OpenSSH 6.7 or older: - ```shell - $ ssh-add -l - > 2048 a0:dd:42:3c:5a:9d:e4:2a:21:52:4e:78:07:6e:c8:4d /Users/USERNAME/.ssh/id_rsa (RSA) - ``` + ```shell + $ ssh-add -l + > 2048 a0:dd:42:3c:5a:9d:e4:2a:21:52:4e:78:07:6e:c8:4d /Users/USERNAME/.ssh/id_rsa (RSA) + ``` If you're using OpenSSH 6.8 or newer: - ```shell - $ ssh-add -l -E md5 - > 2048 MD5:a0:dd:42:3c:5a:9d:e4:2a:21:52:4e:78:07:6e:c8:4d /Users/USERNAME/.ssh/id_rsa (RSA) - ``` + ```shell + $ ssh-add -l -E md5 + > 2048 MD5:a0:dd:42:3c:5a:9d:e4:2a:21:52:4e:78:07:6e:c8:4d /Users/USERNAME/.ssh/id_rsa (RSA) + ``` {% data reusables.user-settings.access_settings %} {% data reusables.user-settings.ssh %} diff --git a/content/code-security/code-scanning/using-codeql-code-scanning-with-your-existing-ci-system/configuring-codeql-cli-in-your-ci-system.md b/content/code-security/code-scanning/using-codeql-code-scanning-with-your-existing-ci-system/configuring-codeql-cli-in-your-ci-system.md index 037279c0bc84..59b631f48edd 100644 --- a/content/code-security/code-scanning/using-codeql-code-scanning-with-your-existing-ci-system/configuring-codeql-cli-in-your-ci-system.md +++ b/content/code-security/code-scanning/using-codeql-code-scanning-with-your-existing-ci-system/configuring-codeql-cli-in-your-ci-system.md @@ -132,10 +132,10 @@ $ 1. Create a {% data variables.product.prodname_codeql %} database (see above). 2. Run `codeql database analyze` on the database and specify which {% ifversion codeql-packs %}packs and/or {% endif %}queries to use. - ```shell - codeql database analyze <database> --format=<format> \ - --output=<output> {% ifversion codeql-packs %}--download <packs,queries>{% else %}<queries>{% endif %} - ``` + ```shell + codeql database analyze <database> --format=<format> \ + --output=<output> {% ifversion codeql-packs %}--download <packs,queries>{% else %}<queries>{% endif %} + ``` {% note %} diff --git a/content/code-security/codeql-cli/codeql-cli-reference/about-codeql-packs.md b/content/code-security/codeql-cli/codeql-cli-reference/about-codeql-packs.md index 00799713a5c6..a5d52da53776 100644 --- a/content/code-security/codeql-cli/codeql-cli-reference/about-codeql-packs.md +++ b/content/code-security/codeql-cli/codeql-cli-reference/about-codeql-packs.md @@ -96,6 +96,7 @@ The following properties are supported in `qlpack.yml` files. ```yaml dependencies: codeql/cpp-all: ^0.0.2` + ``` #### `defaultSuiteFile` @@ -114,7 +115,7 @@ The following properties are supported in `qlpack.yml` files. queries: . exclude: precision: medium - ``` + ``` #### `library` diff --git a/content/copilot/getting-started-with-github-copilot.md b/content/copilot/getting-started-with-github-copilot.md index 955ffe0c2014..d3710d0be914 100644 --- a/content/copilot/getting-started-with-github-copilot.md +++ b/content/copilot/getting-started-with-github-copilot.md @@ -197,9 +197,9 @@ To use {% data variables.product.prodname_copilot %}, you must first install the {% data reusables.copilot.create-c-file %} 1. In the C# file, type the following function signature. {% data variables.product.prodname_copilot %} will automatically suggest an entire function body in grayed text, as shown below. The exact suggestion may vary. - ```csharp{:copy} - int CalculateDaysBetweenDates( - ``` + ```csharp{:copy} + int CalculateDaysBetweenDates( + ``` {% data reusables.copilot.accept-suggestion %} @@ -277,9 +277,9 @@ To use {% data variables.product.prodname_copilot %}, you must first install the {% data reusables.copilot.create-js-file %} 1. In the JavaScript file, type the following function header. {% data variables.product.prodname_copilot %} will automatically suggest an entire function body in grayed text, as shown below. The exact suggestion may vary. - ```javascript{:copy} - function calculateDaysBetweenDates(begin, end) { - ``` + ```javascript{:copy} + function calculateDaysBetweenDates(begin, end) { + ``` {% data reusables.copilot.accept-suggestion %} @@ -289,9 +289,9 @@ To use {% data variables.product.prodname_copilot %}, you must first install the {% data reusables.copilot.create-js-file %} 1. In the JavaScript file, type the following function header. {% data variables.product.prodname_copilot %} will show you a suggestion. - ```javascript{:copy} - function calculateDaysBetweenDates(begin, end) { - ``` + ```javascript{:copy} + function calculateDaysBetweenDates(begin, end) { + ``` {% data reusables.copilot.see-alternative-suggestions %} | OS | See next suggestion | See previous suggestion | @@ -308,9 +308,9 @@ To use {% data variables.product.prodname_copilot %}, you must first install the {% data reusables.copilot.create-js-file %} 1. In the JavaScript file, type the following function header. {% data variables.product.prodname_copilot %} will show you a suggestion. - ```javascript{:copy} - function calculateDaysBetweenDates(begin, end) { - ``` + ```javascript{:copy} + function calculateDaysBetweenDates(begin, end) { + ``` 1. To open a new tab with multiple additional options, press Ctrl+Enter. 1. To accept a suggestion, above the suggestion, click **Accept Solution**. To reject all suggestions, close the tab. diff --git a/content/get-started/getting-started-with-git/associating-text-editors-with-git.md b/content/get-started/getting-started-with-git/associating-text-editors-with-git.md index 428578adfd6b..7aa8b3c80d94 100644 --- a/content/get-started/getting-started-with-git/associating-text-editors-with-git.md +++ b/content/get-started/getting-started-with-git/associating-text-editors-with-git.md @@ -24,9 +24,9 @@ shortTitle: Associate text editors 1. Install [{% data variables.product.prodname_vscode %}](https://code.visualstudio.com/) ({% data variables.product.prodname_vscode_shortname %}). For more information, see "[Setting up {% data variables.product.prodname_vscode_shortname %}](https://code.visualstudio.com/Docs/setup/setup-overview)" in the {% data variables.product.prodname_vscode_shortname %} documentation. {% data reusables.command_line.open_the_multi_os_terminal %} 1. Type this command: - ```shell - $ git config --global core.editor "code --wait" - ``` + ```shell + $ git config --global core.editor "code --wait" + ``` {% endmac %} @@ -35,9 +35,9 @@ shortTitle: Associate text editors 1. Install [{% data variables.product.prodname_vscode %}](https://code.visualstudio.com/) ({% data variables.product.prodname_vscode_shortname %}). For more information, see "[Setting up {% data variables.product.prodname_vscode_shortname %}](https://code.visualstudio.com/Docs/setup/setup-overview)" in the {% data variables.product.prodname_vscode_shortname %} documentation. {% data reusables.command_line.open_the_multi_os_terminal %} 1. Type this command: - ```shell - $ git config --global core.editor "code --wait" - ``` + ```shell + $ git config --global core.editor "code --wait" + ``` {% endwindows %} @@ -46,9 +46,9 @@ shortTitle: Associate text editors 1. Install [{% data variables.product.prodname_vscode %}](https://code.visualstudio.com/) ({% data variables.product.prodname_vscode_shortname %}). For more information, see "[Setting up {% data variables.product.prodname_vscode_shortname %}](https://code.visualstudio.com/Docs/setup/setup-overview)" in the {% data variables.product.prodname_vscode_shortname %} documentation. {% data reusables.command_line.open_the_multi_os_terminal %} 1. Type this command: - ```shell - $ git config --global core.editor "code --wait" - ``` + ```shell + $ git config --global core.editor "code --wait" + ``` {% endlinux %} @@ -59,9 +59,9 @@ shortTitle: Associate text editors 1. Install [Sublime Text](https://www.sublimetext.com/). For more information, see "[Installation](https://docs.sublimetext.io/guide/getting-started/installation.html)" in the Sublime Text documentation. {% data reusables.command_line.open_the_multi_os_terminal %} 1. Type this command: - ```shell - $ git config --global core.editor "subl -n -w" - ``` + ```shell + $ git config --global core.editor "subl -n -w" + ``` {% endmac %} @@ -70,9 +70,9 @@ shortTitle: Associate text editors 1. Install [Sublime Text](https://www.sublimetext.com/). For more information, see "[Installation](https://docs.sublimetext.io/guide/getting-started/installation.html)" in the Sublime Text documentation. {% data reusables.command_line.open_the_multi_os_terminal %} 1. Type this command: - ```shell - $ git config --global core.editor "'C:/Program Files (x86)/sublime text 3/subl.exe' -w" - ``` + ```shell + $ git config --global core.editor "'C:/Program Files (x86)/sublime text 3/subl.exe' -w" + ``` {% endwindows %} @@ -81,9 +81,9 @@ shortTitle: Associate text editors 1. Install [Sublime Text](https://www.sublimetext.com/). For more information, see "[Installation](https://docs.sublimetext.io/guide/getting-started/installation.html)" in the Sublime Text documentation. {% data reusables.command_line.open_the_multi_os_terminal %} 1. Type this command: - ```shell - $ git config --global core.editor "subl -n -w" - ``` + ```shell + $ git config --global core.editor "subl -n -w" + ``` {% endlinux %} @@ -95,9 +95,9 @@ shortTitle: Associate text editors 1. Install TextMate's `mate` shell utility. For more information, see "[`mate` and `rmate`](https://macromates.com/blog/2011/mate-and-rmate/)" in the TextMate documentation. {% data reusables.command_line.open_the_multi_os_terminal %} 1. Type this command: - ```shell - $ git config --global core.editor "mate -w" - ``` + ```shell + $ git config --global core.editor "mate -w" + ``` {% endmac %} @@ -108,8 +108,8 @@ shortTitle: Associate text editors 1. Install Notepad++ from https://notepad-plus-plus.org/. For more information, see "[Getting started](https://npp-user-manual.org/docs/getting-started/)" in the Notepad++ documentation. {% data reusables.command_line.open_the_multi_os_terminal %} 1. Type this command: - ```shell - $ git config --global core.editor "'C:/Program Files (x86)/Notepad++/notepad++.exe' -multiInst -notabbar -nosession -noPlugin" - ``` + ```shell + $ git config --global core.editor "'C:/Program Files (x86)/Notepad++/notepad++.exe' -multiInst -notabbar -nosession -noPlugin" + ``` -{% endwindows %} \ No newline at end of file +{% endwindows %} diff --git a/content/get-started/getting-started-with-git/caching-your-github-credentials-in-git.md b/content/get-started/getting-started-with-git/caching-your-github-credentials-in-git.md index 644daeba38d9..f3c09c86b9f4 100644 --- a/content/get-started/getting-started-with-git/caching-your-github-credentials-in-git.md +++ b/content/get-started/getting-started-with-git/caching-your-github-credentials-in-git.md @@ -40,15 +40,15 @@ For more information about authenticating with {% data variables.product.prodnam {% mac %} 1. Install Git using [Homebrew](https://brew.sh/): - ```shell - $ brew install git - ``` + ```shell + $ brew install git + ``` 2. Install GCM using Homebrew: - ```shell - $ brew tap microsoft/git - $ brew install --cask git-credential-manager-core - ``` + ```shell + $ brew tap microsoft/git + $ brew install --cask git-credential-manager-core + ``` For MacOS, you don't need to run `git config` because GCM automatically configures Git for you. {% data reusables.gcm-core.next-time-you-clone %} diff --git a/content/get-started/getting-started-with-git/configuring-git-to-handle-line-endings.md b/content/get-started/getting-started-with-git/configuring-git-to-handle-line-endings.md index 676651b64cb6..da29e0c6b1b2 100644 --- a/content/get-started/getting-started-with-git/configuring-git-to-handle-line-endings.md +++ b/content/get-started/getting-started-with-git/configuring-git-to-handle-line-endings.md @@ -110,22 +110,22 @@ When you set the `core.autocrlf` option or commit a *.gitattributes* file, you m To ensure that all the line endings in your repository match your new configuration, backup your files with Git, delete all files in your repository (except the `.git` directory), then restore the files all at once. 1. Save your current files in Git, so that none of your work is lost. - ```shell - $ git add . -u - $ git commit -m "Saving files before refreshing line endings" - ``` + ```shell + $ git add . -u + $ git commit -m "Saving files before refreshing line endings" + ``` 2. Add all your changed files back and normalize the line endings. - ```shell - $ git add --renormalize . - ``` + ```shell + $ git add --renormalize . + ``` 3. Show the rewritten, normalized files. - ```shell - $ git status - ``` + ```shell + $ git status + ``` 4. Commit the changes to your repository. - ```shell - $ git commit -m "Normalize all the line endings" - ``` + ```shell + $ git commit -m "Normalize all the line endings" + ``` ## Further reading diff --git a/content/get-started/getting-started-with-git/ignoring-files.md b/content/get-started/getting-started-with-git/ignoring-files.md index 46ecf154e880..0ba67e77356e 100644 --- a/content/get-started/getting-started-with-git/ignoring-files.md +++ b/content/get-started/getting-started-with-git/ignoring-files.md @@ -44,9 +44,9 @@ You can also create a global *.gitignore* file to define a list of rules for ign {% data reusables.command_line.open_the_multi_os_terminal %} 2. Configure Git to use the exclude file *~/.gitignore_global* for all Git repositories. - ```shell - $ git config --global core.excludesfile ~/.gitignore_global - ``` + ```shell + $ git config --global core.excludesfile ~/.gitignore_global + ``` ## Excluding local files without creating a *.gitignore* file diff --git a/content/get-started/getting-started-with-git/managing-remote-repositories.md b/content/get-started/getting-started-with-git/managing-remote-repositories.md index 972377eb6182..cd2490f8e7cd 100644 --- a/content/get-started/getting-started-with-git/managing-remote-repositories.md +++ b/content/get-started/getting-started-with-git/managing-remote-repositories.md @@ -89,22 +89,22 @@ git@{% data variables.command_line.codeblock %}:OWNER/REPOSITORY.git {% data reusables.command_line.open_the_multi_os_terminal %} 2. Change the current working directory to your local project. 3. List your existing remotes in order to get the name of the remote you want to change. - ```shell - $ git remote -v - > origin git@{% data variables.command_line.codeblock %}:OWNER/REPOSITORY.git (fetch) - > origin git@{% data variables.command_line.codeblock %}:OWNER/REPOSITORY.git (push) - ``` + ```shell + $ git remote -v + > origin git@{% data variables.command_line.codeblock %}:OWNER/REPOSITORY.git (fetch) + > origin git@{% data variables.command_line.codeblock %}:OWNER/REPOSITORY.git (push) + ``` 4. Change your remote's URL from SSH to HTTPS with the `git remote set-url` command. - ```shell - $ git remote set-url origin https://{% data variables.command_line.codeblock %}/OWNER/REPOSITORY.git - ``` + ```shell + $ git remote set-url origin https://{% data variables.command_line.codeblock %}/OWNER/REPOSITORY.git + ``` 5. Verify that the remote URL has changed. - ```shell - $ git remote -v - # Verify new remote URL - > origin https://{% data variables.command_line.codeblock %}/OWNER/REPOSITORY.git (fetch) - > origin https://{% data variables.command_line.codeblock %}/OWNER/REPOSITORY.git (push) - ``` + ```shell + $ git remote -v + # Verify new remote URL + > origin https://{% data variables.command_line.codeblock %}/OWNER/REPOSITORY.git (fetch) + > origin https://{% data variables.command_line.codeblock %}/OWNER/REPOSITORY.git (push) + ``` The next time you `git fetch`, `git pull`, or `git push` to the remote repository, you'll be asked for your GitHub username and password. {% data reusables.user-settings.password-authentication-deprecation %} @@ -115,22 +115,22 @@ You can [use a credential helper](/get-started/getting-started-with-git/caching- {% data reusables.command_line.open_the_multi_os_terminal %} 2. Change the current working directory to your local project. 3. List your existing remotes in order to get the name of the remote you want to change. - ```shell - $ git remote -v - > origin https://{% data variables.command_line.codeblock %}/OWNER/REPOSITORY.git (fetch) - > origin https://{% data variables.command_line.codeblock %}/OWNER/REPOSITORY.git (push) - ``` + ```shell + $ git remote -v + > origin https://{% data variables.command_line.codeblock %}/OWNER/REPOSITORY.git (fetch) + > origin https://{% data variables.command_line.codeblock %}/OWNER/REPOSITORY.git (push) + ``` 4. Change your remote's URL from HTTPS to SSH with the `git remote set-url` command. - ```shell - $ git remote set-url origin git@{% data variables.command_line.codeblock %}:OWNER/REPOSITORY.git - ``` + ```shell + $ git remote set-url origin git@{% data variables.command_line.codeblock %}:OWNER/REPOSITORY.git + ``` 5. Verify that the remote URL has changed. - ```shell - $ git remote -v - # Verify new remote URL - > origin git@{% data variables.command_line.codeblock %}: OWNER/REPOSITORY.git (fetch) - > origin git@{% data variables.command_line.codeblock %}: OWNER/REPOSITORY.git (push) - ``` + ```shell + $ git remote -v + # Verify new remote URL + > origin git@{% data variables.command_line.codeblock %}: OWNER/REPOSITORY.git (fetch) + > origin git@{% data variables.command_line.codeblock %}: OWNER/REPOSITORY.git (push) + ``` ### Troubleshooting: No such remote '[name]' diff --git a/content/get-started/quickstart/contributing-to-projects.md b/content/get-started/quickstart/contributing-to-projects.md index 8f6484c5e357..da5971f90100 100644 --- a/content/get-started/quickstart/contributing-to-projects.md +++ b/content/get-started/quickstart/contributing-to-projects.md @@ -59,19 +59,19 @@ You can clone your fork with the command line, {% data variables.product.prodnam {% data reusables.command_line.open_the_multi_os_terminal %} {% data reusables.command_line.change-current-directory-clone %} 4. Type `git clone`, and then paste the URL you copied earlier. It will look like this, with your {% data variables.product.product_name %} username instead of `YOUR-USERNAME`: - ```shell - $ git clone https://{% data variables.command_line.codeblock %}/YOUR-USERNAME/Spoon-Knife - ``` + ```shell + $ git clone https://{% data variables.command_line.codeblock %}/YOUR-USERNAME/Spoon-Knife + ``` 5. Press **Enter**. Your local clone will be created. - ```shell - $ git clone https://{% data variables.command_line.codeblock %}/YOUR-USERNAME/Spoon-Knife - > Cloning into `Spoon-Knife`... - > remote: Counting objects: 10, done. - > remote: Compressing objects: 100% (8/8), done. - > remove: Total 10 (delta 1), reused 10 (delta 1) - > Unpacking objects: 100% (10/10), done. - ``` + ```shell + $ git clone https://{% data variables.command_line.codeblock %}/YOUR-USERNAME/Spoon-Knife + > Cloning into `Spoon-Knife`... + > remote: Counting objects: 10, done. + > remote: Compressing objects: 100% (8/8), done. + > remove: Total 10 (delta 1), reused 10 (delta 1) + > Unpacking objects: 100% (10/10), done. + ``` {% endwebui %} diff --git a/content/get-started/quickstart/fork-a-repo.md b/content/get-started/quickstart/fork-a-repo.md index 47655f1af089..83aa610a0eb2 100644 --- a/content/get-started/quickstart/fork-a-repo.md +++ b/content/get-started/quickstart/fork-a-repo.md @@ -114,19 +114,19 @@ Right now, you have a fork of the Spoon-Knife repository, but you do not have th {% data reusables.command_line.open_the_multi_os_terminal %} {% data reusables.command_line.change-current-directory-clone %} 4. Type `git clone`, and then paste the URL you copied earlier. It will look like this, with your {% data variables.product.product_name %} username instead of `YOUR-USERNAME`: - ```shell - $ git clone https://{% data variables.command_line.codeblock %}/YOUR-USERNAME/Spoon-Knife - ``` + ```shell + $ git clone https://{% data variables.command_line.codeblock %}/YOUR-USERNAME/Spoon-Knife + ``` 5. Press **Enter**. Your local clone will be created. - ```shell - $ git clone https://{% data variables.command_line.codeblock %}/YOUR-USERNAME/Spoon-Knife - > Cloning into `Spoon-Knife`... - > remote: Counting objects: 10, done. - > remote: Compressing objects: 100% (8/8), done. - > remote: Total 10 (delta 1), reused 10 (delta 1) - > Unpacking objects: 100% (10/10), done. - ``` + ```shell + $ git clone https://{% data variables.command_line.codeblock %}/YOUR-USERNAME/Spoon-Knife + > Cloning into `Spoon-Knife`... + > remote: Counting objects: 10, done. + > remote: Compressing objects: 100% (8/8), done. + > remote: Total 10 (delta 1), reused 10 (delta 1) + > Unpacking objects: 100% (10/10), done. + ``` {% endwebui %} @@ -167,25 +167,25 @@ When you fork a project in order to propose changes to the upstream repository, - To go into one of your listed directories, type `cd your_listed_directory`. - To go up one directory, type `cd ..`. 5. Type `git remote -v` and press **Enter**. You will see the current configured remote repository for your fork. - ```shell - $ git remote -v - > origin https://{% data variables.command_line.codeblock %}/YOUR_USERNAME/YOUR_FORK.git (fetch) - > origin https://{% data variables.command_line.codeblock %}/YOUR_USERNAME/YOUR_FORK.git (push) - ``` + ```shell + $ git remote -v + > origin https://{% data variables.command_line.codeblock %}/YOUR_USERNAME/YOUR_FORK.git (fetch) + > origin https://{% data variables.command_line.codeblock %}/YOUR_USERNAME/YOUR_FORK.git (push) + ``` 6. Type `git remote add upstream`, and then paste the URL you copied in Step 3 and press **Enter**. It will look like this: - ```shell - $ git remote add upstream https://{% data variables.command_line.codeblock %}/ORIGINAL_OWNER/Spoon-Knife.git - ``` + ```shell + $ git remote add upstream https://{% data variables.command_line.codeblock %}/ORIGINAL_OWNER/Spoon-Knife.git + ``` 7. To verify the new upstream repository you have specified for your fork, type `git remote -v` again. You should see the URL for your fork as `origin`, and the URL for the upstream repository as `upstream`. - ```shell - $ git remote -v - > origin https://{% data variables.command_line.codeblock %}/YOUR_USERNAME/YOUR_FORK.git (fetch) - > origin https://{% data variables.command_line.codeblock %}/YOUR_USERNAME/YOUR_FORK.git (push) - > upstream https://{% data variables.command_line.codeblock %}/ORIGINAL_OWNER/ORIGINAL_REPOSITORY.git (fetch) - > upstream https://{% data variables.command_line.codeblock %}/ORIGINAL_OWNER/ORIGINAL_REPOSITORY.git (push) - ``` + ```shell + $ git remote -v + > origin https://{% data variables.command_line.codeblock %}/YOUR_USERNAME/YOUR_FORK.git (fetch) + > origin https://{% data variables.command_line.codeblock %}/YOUR_USERNAME/YOUR_FORK.git (push) + > upstream https://{% data variables.command_line.codeblock %}/ORIGINAL_OWNER/ORIGINAL_REPOSITORY.git (fetch) + > upstream https://{% data variables.command_line.codeblock %}/ORIGINAL_OWNER/ORIGINAL_REPOSITORY.git (push) + ``` Now, you can keep your fork synced with the upstream repository with a few Git commands. For more information, see "[AUTOTITLE](/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork)." diff --git a/content/get-started/using-git/about-git-subtree-merges.md b/content/get-started/using-git/about-git-subtree-merges.md index 1cd822c1e799..461fdd7ef5c3 100644 --- a/content/get-started/using-git/about-git-subtree-merges.md +++ b/content/get-started/using-git/about-git-subtree-merges.md @@ -29,62 +29,63 @@ The best way to explain subtree merges is to show by example. We will: {% data reusables.command_line.open_the_multi_os_terminal %} 2. Create a new directory and navigate to it. - ```shell - $ mkdir test - $ cd test - ``` + ```shell + $ mkdir test + $ cd test + ``` 3. Initialize a new Git repository. - ```shell - $ git init - > Initialized empty Git repository in /Users/octocat/tmp/test/.git/ - ``` + ```shell + $ git init + > Initialized empty Git repository in /Users/octocat/tmp/test/.git/ + ``` 4. Create and commit a new file. - ```shell - $ touch .gitignore - $ git add .gitignore - $ git commit -m "initial commit" - > [main (root-commit) 3146c2a] initial commit - > 0 files changed, 0 insertions(+), 0 deletions(-) - > create mode 100644 .gitignore - ``` + ```shell + $ touch .gitignore + $ git add .gitignore + $ git commit -m "initial commit" + > [main (root-commit) 3146c2a] initial commit + > 0 files changed, 0 insertions(+), 0 deletions(-) + > create mode 100644 .gitignore + ``` ## Adding a new repository as a subtree 1. Add a new remote URL pointing to the separate project that we're interested in. - ```shell - $ git remote add -f spoon-knife https://github.com/octocat/Spoon-Knife.git - > Updating spoon-knife - > warning: no common commits - > remote: Counting objects: 1732, done. - > remote: Compressing objects: 100% (750/750), done. - > remote: Total 1732 (delta 1086), reused 1558 (delta 967) - > Receiving objects: 100% (1732/1732), 528.19 KiB | 621 KiB/s, done. - > Resolving deltas: 100% (1086/1086), done. - > From https://github.com/octocat/Spoon-Knife - > * [new branch] main -> Spoon-Knife/main - ``` + ```shell + $ git remote add -f spoon-knife https://github.com/octocat/Spoon-Knife.git + > Updating spoon-knife + > warning: no common commits + > remote: Counting objects: 1732, done. + > remote: Compressing objects: 100% (750/750), done. + > remote: Total 1732 (delta 1086), reused 1558 (delta 967) + > Receiving objects: 100% (1732/1732), 528.19 KiB | 621 KiB/s, done. + > Resolving deltas: 100% (1086/1086), done. + > From https://github.com/octocat/Spoon-Knife + > * [new branch] main -> Spoon-Knife/main + ``` 2. Merge the `Spoon-Knife` project into the local Git project. This doesn't change any of your files locally, but it does prepare Git for the next step. - If you're using Git 2.9 or above: - ```shell - $ git merge -s ours --no-commit --allow-unrelated-histories spoon-knife/main - > Automatic merge went well; stopped before committing as requested - ``` - - If you're using Git 2.8 or below: - ```shell - $ git merge -s ours --no-commit spoon-knife/main - > Automatic merge went well; stopped before committing as requested - ``` + If you're using Git 2.9 or above: + ```shell + $ git merge -s ours --no-commit --allow-unrelated-histories spoon-knife/main + > Automatic merge went well; stopped before committing as requested + ``` + + If you're using Git 2.8 or below: + ```shell + $ git merge -s ours --no-commit spoon-knife/main + > Automatic merge went well; stopped before committing as requested + ``` 3. Create a new directory called **spoon-knife**, and copy the Git history of the `Spoon-Knife` project into it. - ```shell - $ git read-tree --prefix=spoon-knife/ -u spoon-knife/main - ``` + ```shell + $ git read-tree --prefix=spoon-knife/ -u spoon-knife/main + > fatal: refusing to merge unrelated histories + ``` 4. Commit the changes to keep them safe. - ```shell - $ git commit -m "Subtree merged in spoon-knife" - > [main fe0ca25] Subtree merged in spoon-knife - ``` + ```shell + $ git commit -m "Subtree merged in spoon-knife" + > [main fe0ca25] Subtree merged in spoon-knife + ``` Although we've only added one subproject, any number of subprojects can be incorporated into a Git repository. diff --git a/content/get-started/working-with-subversion-on-github/support-for-subversion-clients.md b/content/get-started/working-with-subversion-on-github/support-for-subversion-clients.md index d4d1fd570a63..5804842d5a8a 100644 --- a/content/get-started/working-with-subversion-on-github/support-for-subversion-clients.md +++ b/content/get-started/working-with-subversion-on-github/support-for-subversion-clients.md @@ -28,26 +28,26 @@ Subversion checkouts are different: they mix the repository data in the working {% data reusables.repositories.copy-clone-url %} 3. Make an empty checkout of the repository: - ```shell - $ svn co --depth empty https://github.com/USER/REPO - > Checked out revision 1. - $ cd REPO - ``` + ```shell + $ svn co --depth empty https://github.com/USER/REPO + > Checked out revision 1. + $ cd REPO + ``` 4. Get the `trunk` branch. The Subversion bridge maps trunk to the Git HEAD branch. - ```shell - $ svn up trunk - > A trunk - > A trunk/README.md - > A trunk/gizmo.rb - > Updated to revision 1. - ``` + ```shell + $ svn up trunk + > A trunk + > A trunk/README.md + > A trunk/gizmo.rb + > Updated to revision 1. + ``` 5. Get an empty checkout of the `branches` directory. This is where all of the non-`HEAD` branches live, and where you'll be making feature branches. - ```shell - $ svn up --depth empty branches - Updated to revision 1. - ``` + ```shell + $ svn up --depth empty branches + Updated to revision 1. + ``` ### Creating branches diff --git a/content/migrations/importing-source-code/using-the-command-line-to-import-source-code/adding-locally-hosted-code-to-github.md b/content/migrations/importing-source-code/using-the-command-line-to-import-source-code/adding-locally-hosted-code-to-github.md index b79b81dc5402..0884321c07ac 100644 --- a/content/migrations/importing-source-code/using-the-command-line-to-import-source-code/adding-locally-hosted-code-to-github.md +++ b/content/migrations/importing-source-code/using-the-command-line-to-import-source-code/adding-locally-hosted-code-to-github.md @@ -62,10 +62,10 @@ If your locally-hosted code isn't tracked by any VCS, the first step is to initi # Adds the files in the local repository and stages them for commit. {% data reusables.git.unstage-codeblock %} ``` 1. Commit the files that you've staged in your local repository. - ```shell - $ git commit -m "First commit" - # Commits the tracked changes and prepares them to be pushed to a remote repository. {% data reusables.git.reset-head-to-previous-commit-codeblock %} - ``` + ```shell + $ git commit -m "First commit" + # Commits the tracked changes and prepares them to be pushed to a remote repository. {% data reusables.git.reset-head-to-previous-commit-codeblock %} + ``` ## Importing a Git repository with the command line @@ -93,17 +93,17 @@ After you've initialized a Git repository, you can push the repository to {% dat {% data reusables.command_line.open_the_multi_os_terminal %} 1. Change the current working directory to your local project. 1. [Add the URL for the remote repository](/get-started/getting-started-with-git/managing-remote-repositories) where your local repository will be pushed. - ```shell - $ git remote add origin <REMOTE_URL> - # Sets the new remote - $ git remote -v - # Verifies the new remote URL - ``` + ```shell + $ git remote add origin <REMOTE_URL> + # Sets the new remote + $ git remote -v + # Verifies the new remote URL + ``` 1. [Push the changes](/get-started/using-git/pushing-commits-to-a-remote-repository) in your local repository to {% data variables.location.product_location %}. - ```shell - $ git push -u origin main - # Pushes the changes in your local repository up to the remote repository you specified as the origin - ``` + ```shell + $ git push -u origin main + # Pushes the changes in your local repository up to the remote repository you specified as the origin + ``` {% endmac %} @@ -116,17 +116,17 @@ After you've initialized a Git repository, you can push the repository to {% dat {% data reusables.command_line.open_the_multi_os_terminal %} 1. Change the current working directory to your local project. 1. In the Command prompt, [add the URL for the remote repository](/get-started/getting-started-with-git/managing-remote-repositories) where your local repository will be pushed. - ```shell - $ git remote add origin <REMOTE_URL> - # Sets the new remote - $ git remote -v - # Verifies the new remote URL + ```shell + $ git remote add origin <REMOTE_URL> + # Sets the new remote + $ git remote -v + # Verifies the new remote URL ``` 1. [Push the changes](/get-started/using-git/pushing-commits-to-a-remote-repository) in your local repository to {% data variables.location.product_location %}. - ```shell - $ git push origin main - # Pushes the changes in your local repository up to the remote repository you specified as the origin - ``` + ```shell + $ git push origin main + # Pushes the changes in your local repository up to the remote repository you specified as the origin + ``` {% endwindows %} @@ -135,21 +135,21 @@ After you've initialized a Git repository, you can push the repository to {% dat {% data reusables.migrations.create-empty-repo %} 1. At the top of your repository on {% ifversion ghae %}{% data variables.product.product_name %}{% else %}{% data variables.location.product_location %}{% endif %}'s Quick Setup page, click {% octicon "copy" aria-label="Copy to clipboard" %} to copy the remote repository URL. - ![Screenshot of the "Quick Setup" header in a repository. Next to the remote URL, an icon of two overlapping squares is highlighted with an orange outline.](/assets/images/help/repository/copy-remote-repository-url-quick-setup.png) + ![Screenshot of the "Quick Setup" header in a repository. Next to the remote URL, an icon of two overlapping squares is highlighted with an orange outline.](/assets/images/help/repository/copy-remote-repository-url-quick-setup.png) {% data reusables.command_line.open_the_multi_os_terminal %} 1. Change the current working directory to your local project. 1. [Add the URL for the remote repository](/get-started/getting-started-with-git/managing-remote-repositories) where your local repository will be pushed. - ```shell - $ git remote add origin <REMOTE_URL> - # Sets the new remote - $ git remote -v - # Verifies the new remote URL - ``` + ```shell + $ git remote add origin <REMOTE_URL> + # Sets the new remote + $ git remote -v + # Verifies the new remote URL + ``` 1. [Push the changes](/get-started/using-git/pushing-commits-to-a-remote-repository) in your local repository to {% data variables.location.product_location %}. - ```shell - $ git push origin main - # Pushes the changes in your local repository up to the remote repository you specified as the origin - ``` + ```shell + $ git push origin main + # Pushes the changes in your local repository up to the remote repository you specified as the origin + ``` {% endlinux %} diff --git a/content/migrations/importing-source-code/using-the-command-line-to-import-source-code/importing-an-external-git-repository-using-the-command-line.md b/content/migrations/importing-source-code/using-the-command-line-to-import-source-code/importing-an-external-git-repository-using-the-command-line.md index a314879067b2..5eb20bef0fba 100644 --- a/content/migrations/importing-source-code/using-the-command-line-to-import-source-code/importing-an-external-git-repository-using-the-command-line.md +++ b/content/migrations/importing-source-code/using-the-command-line-to-import-source-code/importing-an-external-git-repository-using-the-command-line.md @@ -32,20 +32,20 @@ For purposes of demonstration, we'll use: 1. [Create a new repository on {% data variables.product.product_name %}](/repositories/creating-and-managing-repositories/creating-a-new-repository). You'll import your external Git repository to this new repository. 2. On the command line, make a "bare" clone of the external repository using the external clone URL. This creates a full copy of the data, but without a working directory for editing files, and ensures a clean, fresh export of all the old data. - ```shell - $ git clone --bare https://external-host.com/EXTUSER/REPO.git - # Makes a bare clone of the external repository in a local directory - ``` + ```shell + $ git clone --bare https://external-host.com/EXTUSER/REPO.git + # Makes a bare clone of the external repository in a local directory + ``` 3. Push the locally cloned repository to {% data variables.product.product_name %} using the "mirror" option, which ensures that all references, such as branches and tags, are copied to the imported repository. - ```shell - $ cd REPO.git - $ git push --mirror https://{% data variables.command_line.codeblock %}/USER/REPO.git - # Pushes the mirror to the new repository on {% ifversion ghae %}{% data variables.product.product_name %}{% else %}{% data variables.location.product_location %}{% endif %} - ``` + ```shell + $ cd REPO.git + $ git push --mirror https://{% data variables.command_line.codeblock %}/USER/REPO.git + # Pushes the mirror to the new repository on {% ifversion ghae %}{% data variables.product.product_name %}{% else %}{% data variables.location.product_location %}{% endif %} + ``` 4. Remove the temporary local repository. - ```shell - $ cd .. - $ rm -rf REPO.git - ``` + ```shell + $ cd .. + $ rm -rf REPO.git + ``` If the repository you are importing contains large files, you may run into a warning or error. For more information on large files and how to manage them, see "[AUTOTITLE](/repositories/working-with-files/managing-large-files/about-large-files-on-github)." diff --git a/content/migrations/importing-source-code/using-the-command-line-to-import-source-code/importing-from-other-version-control-systems-with-the-administrative-shell.md b/content/migrations/importing-source-code/using-the-command-line-to-import-source-code/importing-from-other-version-control-systems-with-the-administrative-shell.md index 4b2a09fd88e2..21ea0512ef49 100644 --- a/content/migrations/importing-source-code/using-the-command-line-to-import-source-code/importing-from-other-version-control-systems-with-the-administrative-shell.md +++ b/content/migrations/importing-source-code/using-the-command-line-to-import-source-code/importing-from-other-version-control-systems-with-the-administrative-shell.md @@ -20,61 +20,61 @@ permissions: Site administrators can use the administrative shell to import data {% data reusables.enterprise_installation.ssh-into-instance %} 2. Make a raw clone of the project using the command below, specifying the URL of the source project, and a path to a temporary repository: - ```shell - $ git-import-hg-raw HG-CLONE-URL/PATH/REPO-NAME.git - # Creates a new repository with one or more Git refs in "refs/import/" in the specified path. - ``` + ```shell + $ git-import-hg-raw HG-CLONE-URL/PATH/REPO-NAME.git + # Creates a new repository with one or more Git refs in "refs/import/" in the specified path. + ``` {% data reusables.enterprise_migrations.review-the-import-csv %} 4. Rewrite the authors and branches using the CSV file: - ```shell - $ git-import-rewrite --flavor hg --authors /PATH/AUTHORS-MAP-FILE.csv /PATH/REPO-NAME.git - ``` + ```shell + $ git-import-rewrite --flavor hg --authors /PATH/AUTHORS-MAP-FILE.csv /PATH/REPO-NAME.git + ``` 5. If you haven't yet, [create a new empty repository on {% data variables.product.prodname_ghe_server %}](/repositories/creating-and-managing-repositories/creating-a-new-repository). {% data reusables.command_line.switching_directories_procedural %} 7. Push the imported repository to {% data variables.product.prodname_ghe_server %}: - ```shell - $ git push --mirror PUSH-URL-ON-GITHUB-ENTERPRISE - ``` + ```shell + $ git push --mirror PUSH-URL-ON-GITHUB-ENTERPRISE + ``` ## Importing projects from Subversion {% data reusables.enterprise_installation.ssh-into-instance %} 2. Make a raw clone of the project using the command below, specifying the URL of the source project, and a path to a temporary repository: - ```shell - $ git-import-svn-raw SVN-CLONE-URL /PATH/REPO-NAME.git - # Creates a new repository with one or more Git refs in "refs/import/" in the specified path. - ``` + ```shell + $ git-import-svn-raw SVN-CLONE-URL /PATH/REPO-NAME.git + # Creates a new repository with one or more Git refs in "refs/import/" in the specified path. + ``` {% data reusables.enterprise_migrations.review-the-import-csv %} 4. Rewrite the authors and branches using the CSV file: - ```shell - $ git-import-rewrite --flavor svn --authors /PATH/AUTHORS-MAP-FILE.csv /PATH/REPO-NAME.git - ``` + ```shell + $ git-import-rewrite --flavor svn --authors /PATH/AUTHORS-MAP-FILE.csv /PATH/REPO-NAME.git + ``` 5. If you haven't yet, [create a new empty repository on {% data variables.product.prodname_ghe_server %}](/repositories/creating-and-managing-repositories/creating-a-new-repository). {% data reusables.command_line.switching_directories_procedural %} 7. Push the imported repository to {% data variables.product.prodname_ghe_server %}: - ```shell - $ git push --mirror PUSH-URL-ON-GITHUB-ENTERPRISE - ``` + ```shell + $ git push --mirror PUSH-URL-ON-GITHUB-ENTERPRISE + ``` ## Importing projects from Team Foundation Version Control {% data reusables.enterprise_installation.ssh-into-instance %} 2. Make a raw clone of the project using the command below, specifying the URL of the source project, and a path to a temporary repository: - ```shell - $ git-import-tfs-raw TEAM-FOUNDATION-CLONE-URL /PATH/REPO-NAME.git - # Creates a new repository with one or more Git refs in "refs/import/" in the specified path. - ``` + ```shell + $ git-import-tfs-raw TEAM-FOUNDATION-CLONE-URL /PATH/REPO-NAME.git + # Creates a new repository with one or more Git refs in "refs/import/" in the specified path. + ``` {% data reusables.enterprise_migrations.review-the-import-csv %} 4. Rewrite the authors and branches using the CSV file: - ```shell - $ git-import-rewrite --flavor tfs --authors /PATH/AUTHORS-MAP-FILE.csv /PATH/REPO_NAME.git - ``` + ```shell + $ git-import-rewrite --flavor tfs --authors /PATH/AUTHORS-MAP-FILE.csv /PATH/REPO_NAME.git + ``` 5. If you haven't yet, [create a new empty repository on {% data variables.product.prodname_ghe_server %}](/repositories/creating-and-managing-repositories/creating-a-new-repository). {% data reusables.command_line.switching_directories_procedural %} 7. Push the imported repository to {% data variables.product.prodname_ghe_server %}: - ```shell - $ git push --mirror PUSH-URL-ON-GITHUB-ENTERPRISE - ``` + ```shell + $ git push --mirror PUSH-URL-ON-GITHUB-ENTERPRISE + ``` ## Further reading diff --git a/content/migrations/using-ghe-migrator/exporting-migration-data-from-github-enterprise-server.md b/content/migrations/using-ghe-migrator/exporting-migration-data-from-github-enterprise-server.md index 1780084aae60..4543af2590f5 100644 --- a/content/migrations/using-ghe-migrator/exporting-migration-data-from-github-enterprise-server.md +++ b/content/migrations/using-ghe-migrator/exporting-migration-data-from-github-enterprise-server.md @@ -48,56 +48,56 @@ shortTitle: Export from GHES ``` 3. When prompted, enter your {% data variables.product.prodname_ghe_server %} username: - ```shell - Enter username authorized for migration: admin - ``` + ```shell + Enter username authorized for migration: admin + ``` 4. When prompted for a {% data variables.product.pat_generic %}, enter the access token you created in "[Preparing the {% data variables.product.prodname_ghe_server %} source instance](#preparing-the-github-enterprise-server-source-instance)": - ```shell - Enter {% data variables.product.pat_generic %}: ************** - ``` + ```shell + Enter {% data variables.product.pat_generic %}: ************** + ``` 5. When `ghe-migrator add` has finished it will print the unique "Migration GUID" that it generated to identify this export as well as a list of the resources that were added to the export. You will use the Migration GUID that it generated in subsequent `ghe-migrator add` and `ghe-migrator export` steps to tell `ghe-migrator` to continue operating on the same export. - ```shell - > 101 models added to export - > Migration GUID: EXAMPLE-MIGRATION-GUID - > Number of records in this migration: - > users | 5 - > organizations | 1 - > repositories | 1 - > teams | 3 - > protected_branches | 1 - > pull_request_reviews | 1 - > milestones | 1 - > issues | 3 - > pull_requests | 5 - > pull_request_review_comments | 4 - > commit_comments | 2 - > issue_comments | 10 - > issue_events | 63 - > releases | 3 - > attachments | 4 - > projects | 2 - ``` - Each time you add a new repository with an existing Migration GUID it will update the existing export. If you run `ghe-migrator add` again without a Migration GUID it will start a new export and generate a new Migration GUID. **Do not re-use the Migration GUID generated during an export when you start preparing your migration for import**. + ```shell + > 101 models added to export + > Migration GUID: EXAMPLE-MIGRATION-GUID + > Number of records in this migration: + > users | 5 + > organizations | 1 + > repositories | 1 + > teams | 3 + > protected_branches | 1 + > pull_request_reviews | 1 + > milestones | 1 + > issues | 3 + > pull_requests | 5 + > pull_request_review_comments | 4 + > commit_comments | 2 + > issue_comments | 10 + > issue_events | 63 + > releases | 3 + > attachments | 4 + > projects | 2 + ``` + Each time you add a new repository with an existing Migration GUID it will update the existing export. If you run `ghe-migrator add` again without a Migration GUID it will start a new export and generate a new Migration GUID. **Do not re-use the Migration GUID generated during an export when you start preparing your migration for import**. 6. To add more repositories to the same export, use the `ghe-migrator add` command with the `-g` flag. You'll pass in the new repository URL and the Migration GUID from Step 5: - ```shell - $ ghe-migrator add https://HOSTNAME/USERNAME/OTHER-REPO-NAME -g MIGRATION-GUID --lock - ``` + ```shell + $ ghe-migrator add https://HOSTNAME/USERNAME/OTHER-REPO-NAME -g MIGRATION-GUID --lock + ``` 7. When you've finished adding repositories, generate the migration archive using the `ghe-migrator export` command with the `-g` flag and the Migration GUID from Step 5: - ```shell - $ ghe-migrator export -g MIGRATION-GUID - > Archive saved to: /data/github/current/tmp/MIGRATION-GUID.tar.gz - ``` - * {% data reusables.enterprise_migrations.specify-staging-path %} + ```shell + $ ghe-migrator export -g MIGRATION-GUID + > Archive saved to: /data/github/current/tmp/MIGRATION-GUID.tar.gz + ``` + * {% data reusables.enterprise_migrations.specify-staging-path %} 8. Close the connection to {% data variables.location.product_location %}: - ```shell - $ exit - > logout - > Connection to HOSTNAME closed. - ``` + ```shell + $ exit + > logout + > Connection to HOSTNAME closed. + ``` 9. Copy the migration archive to your computer using the [`scp`](https://acloudguru.com/blog/engineering/ssh-and-scp-howto-tips-tricks#scp) command. The archive file will be named with the Migration GUID: - ```shell - $ scp -P 122 admin@HOSTNAME:/data/github/current/tmp/MIGRATION-GUID.tar.gz ~/Desktop - ``` + ```shell + $ scp -P 122 admin@HOSTNAME:/data/github/current/tmp/MIGRATION-GUID.tar.gz ~/Desktop + ``` {% data reusables.enterprise_migrations.ready-to-import-migrations %} diff --git a/content/migrations/using-ghe-migrator/preparing-to-migrate-data-to-github-enterprise-server.md b/content/migrations/using-ghe-migrator/preparing-to-migrate-data-to-github-enterprise-server.md index 1ab9f38cf520..e9d555e91bab 100644 --- a/content/migrations/using-ghe-migrator/preparing-to-migrate-data-to-github-enterprise-server.md +++ b/content/migrations/using-ghe-migrator/preparing-to-migrate-data-to-github-enterprise-server.md @@ -48,9 +48,9 @@ shortTitle: Prepare to migrate data ``` - If no conflicts are reported, you can safely import the data by following the steps in "[AUTOTITLE](/migrations/using-ghe-migrator/migrating-data-to-github-enterprise-server)". 2. If there are conflicts, using the [`scp`](https://acloudguru.com/blog/engineering/ssh-and-scp-howto-tips-tricks#scp) command, copy *conflicts.csv* to your local computer: - ```shell - $ scp -P 122 admin@HOSTNAME:conflicts.csv ~/Desktop - ``` + ```shell + $ scp -P 122 admin@HOSTNAME:conflicts.csv ~/Desktop + ``` 3. Continue to "[Resolving migration conflicts or setting up custom mappings](#resolving-migration-conflicts-or-setting-up-custom-mappings)". ## Reviewing migration conflicts diff --git a/content/packages/learn-github-packages/connecting-a-repository-to-a-package.md b/content/packages/learn-github-packages/connecting-a-repository-to-a-package.md index 9ba35416c94e..166b1b5af902 100644 --- a/content/packages/learn-github-packages/connecting-a-repository-to-a-package.md +++ b/content/packages/learn-github-packages/connecting-a-repository-to-a-package.md @@ -37,14 +37,14 @@ When you publish a package that is scoped to a personal account or an organizati 1. In your Dockerfile, add this line, replacing {% ifversion ghes %}`HOSTNAME`, {% endif %}`OWNER` and `REPO` with your details: - ```shell - LABEL org.opencontainers.image.source=https://{% ifversion fpt or ghec %}github.com{% else %}HOSTNAME{% endif %}/OWNER/REPO - ``` - For example, if you're the user `octocat` and own `my-repo`{% ifversion ghes > 3.4 %}, and your {% data variables.location.product_location %} hostname is `github.amrom.workers.devpanyname.com`,{% endif %} you would add this line to your Dockerfile: - ```shell - LABEL org.opencontainers.image.source=https://{% ifversion fpt or ghec %}github.com{% else %}{% data reusables.package_registry.container-registry-example-hostname %}{% endif %}/octocat/my-repo - ``` - For more information, see "[LABEL](https://docs.docker.com/engine/reference/builder/#label)" in the official Docker documentation and "[Pre-defined Annotation Keys](https://github.com/opencontainers/image-spec/blob/master/annotations.md#pre-defined-annotation-keys)" in the `opencontainers/image-spec` repository. + ```shell + LABEL org.opencontainers.image.source=https://{% ifversion fpt or ghec %}github.com{% else %}HOSTNAME{% endif %}/OWNER/REPO + ``` + For example, if you're the user `octocat` and own `my-repo`{% ifversion ghes > 3.4 %}, and your {% data variables.location.product_location %} hostname is `github.amrom.workers.devpanyname.com`,{% endif %} you would add this line to your Dockerfile: + ```shell + LABEL org.opencontainers.image.source=https://{% ifversion fpt or ghec %}github.com{% else %}{% data reusables.package_registry.container-registry-example-hostname %}{% endif %}/octocat/my-repo + ``` + For more information, see "[LABEL](https://docs.docker.com/engine/reference/builder/#label)" in the official Docker documentation and "[Pre-defined Annotation Keys](https://github.com/opencontainers/image-spec/blob/master/annotations.md#pre-defined-annotation-keys)" in the `opencontainers/image-spec` repository. 2. Build your container image. This example builds an image from the Dockerfile in the current directory and assigns the image name `hello_docker`. @@ -53,39 +53,39 @@ When you publish a package that is scoped to a personal account or an organizati ``` 3. Optionally, review the details of the Docker image you just created. - ```shell - $ docker images - > REPOSITORY TAG IMAGE ID CREATED SIZE - > hello_docker latest 142e665b1faa 5 seconds ago 125MB - > redis latest afb5e116cac0 3 months ago 111MB - > alpine latest a6215f271958 5 months ago 5.29MB - ``` + ```shell + $ docker images + > REPOSITORY TAG IMAGE ID CREATED SIZE + > hello_docker latest 142e665b1faa 5 seconds ago 125MB + > redis latest afb5e116cac0 3 months ago 111MB + > alpine latest a6215f271958 5 months ago 5.29MB + ``` 4. Assign a name and hosting destination to your Docker image. - ```shell - $ docker tag IMAGE_NAME {% data reusables.package_registry.container-registry-hostname %}/NAMESPACE/NEW_IMAGE_NAME:TAG - ``` + ```shell + $ docker tag IMAGE_NAME {% data reusables.package_registry.container-registry-hostname %}/NAMESPACE/NEW_IMAGE_NAME:TAG + ``` - Replace `NAMESPACE` with the name of the personal account or organization to which you want the package to be scoped. + Replace `NAMESPACE` with the name of the personal account or organization to which you want the package to be scoped. - For example: - ```shell - $ docker tag 38f737a91f39 {% ifversion fpt or ghec %}ghcr.io{% elsif ghes > 3.4 %}{% data reusables.package_registry.container-registry-example-hostname %}{% endif %}/octocat/hello_docker:latest - ``` + For example: + ```shell + $ docker tag 38f737a91f39 {% ifversion fpt or ghec %}ghcr.io{% elsif ghes > 3.4 %}{% data reusables.package_registry.container-registry-example-hostname %}{% endif %}/octocat/hello_docker:latest + ``` 5. If you haven't already, authenticate to the {% data variables.product.prodname_container_registry %}. For more information, see "[AUTOTITLE](/packages/working-with-a-github-packages-registry/working-with-the-container-registry#authenticating-to-the-container-registry)." - {% raw %} - ```shell - $ echo $CR_PAT | docker login {% endraw %}{% data reusables.package_registry.container-registry-hostname %}{% raw %} -u USERNAME --password-stdin - > Login Succeeded - ``` - {% endraw %} + {% raw %} + ```shell + $ echo $CR_PAT | docker login {% endraw %}{% data reusables.package_registry.container-registry-hostname %}{% raw %} -u USERNAME --password-stdin + > Login Succeeded + ``` + {% endraw %} 6. Push your container image to the {% data variables.product.prodname_container_registry %}. - ```shell - $ docker push {% data reusables.package_registry.container-registry-hostname %}/NAMESPACE/IMAGE-NAME:TAG - ``` - For example: - ```shell - $ docker push {% ifversion fpt or ghec %}ghcr.io{% elsif ghes > 3.4 %}{% data reusables.package_registry.container-registry-example-hostname %}{% endif %}/octocat/hello_docker:latest - ``` + ```shell + $ docker push {% data reusables.package_registry.container-registry-hostname %}/NAMESPACE/IMAGE-NAME:TAG + ``` + For example: + ```shell + $ docker push {% ifversion fpt or ghec %}ghcr.io{% elsif ghes > 3.4 %}{% data reusables.package_registry.container-registry-example-hostname %}{% endif %}/octocat/hello_docker:latest + ``` {% endif %} diff --git a/content/packages/working-with-a-github-packages-registry/working-with-the-container-registry.md b/content/packages/working-with-a-github-packages-registry/working-with-the-container-registry.md index 1b35b8222b69..48e8cae1099d 100644 --- a/content/packages/working-with-a-github-packages-registry/working-with-the-container-registry.md +++ b/content/packages/working-with-a-github-packages-registry/working-with-the-container-registry.md @@ -88,20 +88,20 @@ To connect a repository when publishing an image from the command line, and to e To ensure you're always using the same image, you can specify the exact container image version you want to pull by the `digest` SHA value. 1. To find the digest SHA value, use `docker inspect` or `docker pull` and copy the SHA value after `Digest:` - ```shell - $ docker inspect {% data reusables.package_registry.container-registry-hostname %}/NAMESPACE/IMAGE_NAME - ``` + ```shell + $ docker inspect {% data reusables.package_registry.container-registry-hostname %}/NAMESPACE/IMAGE_NAME + ``` Replace `NAMESPACE` with the name of the personal account or organization to which the image is scoped. 2. Remove image locally as needed. - ```shell - $ docker rmi {% data reusables.package_registry.container-registry-hostname %}/NAMESPACE/IMAGE_NAME:latest - ``` + ```shell + $ docker rmi {% data reusables.package_registry.container-registry-hostname %}/NAMESPACE/IMAGE_NAME:latest + ``` 3. Pull the container image with `@YOUR_SHA_VALUE` after the image name. - ```shell - $ docker pull {% data reusables.package_registry.container-registry-hostname %}/NAMESPACE/IMAGE_NAME@sha256:82jf9a84u29hiasldj289498uhois8498hjs29hkuhs - ``` + ```shell + $ docker pull {% data reusables.package_registry.container-registry-hostname %}/NAMESPACE/IMAGE_NAME@sha256:82jf9a84u29hiasldj289498uhois8498hjs29hkuhs + ``` ### Pull by name @@ -149,17 +149,17 @@ This example builds the `hello_docker` image: ## Tagging container images 1. Find the ID for the Docker image you want to tag. - ```shell - $ docker images - > REPOSITORY TAG IMAGE ID CREATED SIZE - > {% data reusables.package_registry.container-registry-hostname %}/my-org/hello_docker latest 38f737a91f39 47 hours ago 91.7MB - > hello-world latest fce289e99eb9 16 months ago 1.84kB - ``` + ```shell + $ docker images + > REPOSITORY TAG IMAGE ID CREATED SIZE + > {% data reusables.package_registry.container-registry-hostname %}/my-org/hello_docker latest 38f737a91f39 47 hours ago 91.7MB + > hello-world latest fce289e99eb9 16 months ago 1.84kB + ``` 2. Tag your Docker image using the image ID and your desired image name and hosting destination. - ```shell - $ docker tag 38f737a91f39 {% data reusables.package_registry.container-registry-hostname %}/NAMESPACE/NEW_IMAGE_NAME:latest - ``` + ```shell + $ docker tag 38f737a91f39 {% data reusables.package_registry.container-registry-hostname %}/NAMESPACE/NEW_IMAGE_NAME:latest + ``` Replace `NAMESPACE` with the name of the personal account or organization to which you want the image to be scoped. diff --git a/content/packages/working-with-a-github-packages-registry/working-with-the-docker-registry.md b/content/packages/working-with-a-github-packages-registry/working-with-the-docker-registry.md index 4f55d1ca5a4d..9c91f7dae17d 100644 --- a/content/packages/working-with-a-github-packages-registry/working-with-the-docker-registry.md +++ b/content/packages/working-with-a-github-packages-registry/working-with-the-docker-registry.md @@ -98,74 +98,74 @@ For more information, see "[Docker login](https://docs.docker.com/engine/referen {% data reusables.package_registry.viewing-packages %} 1. Determine the image name and ID for your docker image using `docker images`. - ```shell - $ docker images - > < > - > REPOSITORY TAG IMAGE ID CREATED SIZE - > IMAGE_NAME VERSION IMAGE_ID 4 weeks ago 1.11MB - ``` + ```shell + $ docker images + > < > + > REPOSITORY TAG IMAGE ID CREATED SIZE + > IMAGE_NAME VERSION IMAGE_ID 4 weeks ago 1.11MB + ``` 2. Using the Docker image ID, tag the docker image, replacing *OWNER* with the name of the personal account or organization that owns the repository, *REPOSITORY* with the name of the repository containing your project, *IMAGE_NAME* with name of the package or image,{% ifversion ghes or ghae %} *HOSTNAME* with the hostname of {% data variables.location.product_location %},{% endif %} and *VERSION* with package version at build time. - {% ifversion fpt or ghec %} - ```shell - $ docker tag IMAGE_ID docker.pkg.github.com/OWNER/REPOSITORY/IMAGE_NAME:VERSION - ``` - {% else %} - {% ifversion ghes %} - If your instance has subdomain isolation enabled: - {% endif %} - ```shell - $ docker tag IMAGE_ID docker.HOSTNAME/OWNER/REPOSITORY/IMAGE_NAME:VERSION - ``` - {% ifversion ghes %} - If your instance has subdomain isolation disabled: - ```shell - $ docker tag IMAGE_ID HOSTNAME/OWNER/REPOSITORY/IMAGE_NAME:VERSION - ``` - {% endif %} - {% endif %} + {% ifversion fpt or ghec %} + ```shell + $ docker tag IMAGE_ID docker.pkg.github.com/OWNER/REPOSITORY/IMAGE_NAME:VERSION + ``` + {% else %} + {% ifversion ghes %} + If your instance has subdomain isolation enabled: + {% endif %} + ```shell + $ docker tag IMAGE_ID docker.HOSTNAME/OWNER/REPOSITORY/IMAGE_NAME:VERSION + ``` + {% ifversion ghes %} + If your instance has subdomain isolation disabled: + ```shell + $ docker tag IMAGE_ID HOSTNAME/OWNER/REPOSITORY/IMAGE_NAME:VERSION + ``` + {% endif %} + {% endif %} 3. If you haven't already built a docker image for the package, build the image, replacing *OWNER* with the name of the personal account or organization that owns the repository, *REPOSITORY* with the name of the repository containing your project, *IMAGE_NAME* with name of the package or image, *VERSION* with package version at build time,{% ifversion ghes or ghae %} *HOSTNAME* with the hostname of {% data variables.location.product_location %},{% endif %} and *PATH* to the image if it isn't in the current working directory. - {% ifversion fpt or ghec %} - ```shell - $ docker build -t docker.pkg.github.com/OWNER/REPOSITORY/IMAGE_NAME:VERSION PATH - ``` - {% else %} - {% ifversion ghes %} - If your instance has subdomain isolation enabled: - {% endif %} - ```shell - $ docker build -t docker.HOSTNAME/OWNER/REPOSITORY/IMAGE_NAME:VERSION PATH - ``` - {% ifversion ghes %} - If your instance has subdomain isolation disabled: - ```shell - $ docker build -t HOSTNAME/OWNER/REPOSITORY/IMAGE_NAME:VERSION PATH - ``` - {% endif %} - {% endif %} + {% ifversion fpt or ghec %} + ```shell + $ docker build -t docker.pkg.github.com/OWNER/REPOSITORY/IMAGE_NAME:VERSION PATH + ``` + {% else %} + {% ifversion ghes %} + If your instance has subdomain isolation enabled: + {% endif %} + ```shell + $ docker build -t docker.HOSTNAME/OWNER/REPOSITORY/IMAGE_NAME:VERSION PATH + ``` + {% ifversion ghes %} + If your instance has subdomain isolation disabled: + ```shell + $ docker build -t HOSTNAME/OWNER/REPOSITORY/IMAGE_NAME:VERSION PATH + ``` + {% endif %} + {% endif %} 4. Publish the image to {% data variables.product.prodname_registry %}. - {% ifversion fpt or ghec %} - ```shell - $ docker push docker.pkg.github.com/OWNER/REPOSITORY/IMAGE_NAME:VERSION - ``` - {% else %} - {% ifversion ghes %} - If your instance has subdomain isolation enabled: - {% endif %} - ```shell - $ docker push docker.HOSTNAME/OWNER/REPOSITORY/IMAGE_NAME:VERSION - ``` - {% ifversion ghes %} - If your instance has subdomain isolation disabled: - ```shell - $ docker push HOSTNAME/OWNER/REPOSITORY/IMAGE_NAME:VERSION - ``` - {% endif %} - {% endif %} - {% note %} - - **Note:** You must push your image using `IMAGE_NAME:VERSION` and not using `IMAGE_NAME:SHA`. - - {% endnote %} + {% ifversion fpt or ghec %} + ```shell + $ docker push docker.pkg.github.com/OWNER/REPOSITORY/IMAGE_NAME:VERSION + ``` + {% else %} + {% ifversion ghes %} + If your instance has subdomain isolation enabled: + {% endif %} + ```shell + $ docker push docker.HOSTNAME/OWNER/REPOSITORY/IMAGE_NAME:VERSION + ``` + {% ifversion ghes %} + If your instance has subdomain isolation disabled: + ```shell + $ docker push HOSTNAME/OWNER/REPOSITORY/IMAGE_NAME:VERSION + ``` + {% endif %} + {% endif %} + {% note %} + + **Note:** You must push your image using `IMAGE_NAME:VERSION` and not using `IMAGE_NAME:SHA`. + + {% endnote %} ### Example publishing a Docker image diff --git a/content/packages/working-with-a-github-packages-registry/working-with-the-nuget-registry.md b/content/packages/working-with-a-github-packages-registry/working-with-the-nuget-registry.md index 81b1f2a8d963..a552c653589d 100644 --- a/content/packages/working-with-a-github-packages-registry/working-with-the-nuget-registry.md +++ b/content/packages/working-with-a-github-packages-registry/working-with-the-nuget-registry.md @@ -119,18 +119,18 @@ If you specify a `RepositoryURL` in your `nuget.config` file, the published pack If you don't already have a {% data variables.product.pat_generic %} to use for your account on {% ifversion ghae %}{% data variables.product.product_name %}{% else %}{% data variables.location.product_location %}{% endif %}, see "[AUTOTITLE](/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token)." 1. Create a new project. Replace `PROJECT_NAME` with the name you'd like to give the project. - ```shell - dotnet new console --name PROJECT_NAME - ``` + ```shell + dotnet new console --name PROJECT_NAME + ``` 2. Package the project. - ```shell - dotnet pack --configuration Release - ``` + ```shell + dotnet pack --configuration Release + ``` 3. Publish the package using your {% data variables.product.pat_generic %} as the API key. Replace `PROJECT_NAME` with the name of the project, `1.0.0` with the version number of the package, and `YOUR_GITHUB_PAT` with your {% data variables.product.pat_generic %}. - ```shell - dotnet nuget push "bin/Release/PROJECT_NAME.1.0.0.nupkg" --api-key YOUR_GITHUB_PAT --source "github" - ``` + ```shell + dotnet nuget push "bin/Release/PROJECT_NAME.1.0.0.nupkg" --api-key YOUR_GITHUB_PAT --source "github" + ``` {% data reusables.package_registry.viewing-packages %} @@ -142,9 +142,9 @@ When publishing, {% ifversion packages-nuget-v2 %}if you are linking your packag {% data reusables.package_registry.authenticate-step %} 2. Create a new project. Replace `PROJECT_NAME` with the name you'd like to give the project. - ```shell - dotnet new console --name PROJECT_NAME - ``` + ```shell + dotnet new console --name PROJECT_NAME + ``` 3. Add your project's specific information to your project's file, which ends in *.csproj*. Make sure to replace: - `1.0.0` with the version number of the package. - `OWNER` with the name of the personal account or organization that owns the repository to which you want to {% ifversion packages-nuget-v2 %}link your package{% else %}publish your package{% endif %}. @@ -167,14 +167,14 @@ When publishing, {% ifversion packages-nuget-v2 %}if you are linking your packag ``` 4. Package the project. - ```shell - dotnet pack --configuration Release - ``` + ```shell + dotnet pack --configuration Release + ``` 5. Publish the package using the `key` you specified in the *nuget.config* file. Replace `PROJECT_NAME` with the name of the project, and replace `1.0.0` with the version number of the package. - ```shell - dotnet nuget push "bin/Release/PROJECT_NAME.1.0.0.nupkg" --source "github" - ``` + ```shell + dotnet nuget push "bin/Release/PROJECT_NAME.1.0.0.nupkg" --source "github" + ``` {% data reusables.package_registry.viewing-packages %} @@ -225,31 +225,31 @@ Using packages from {% data variables.product.prodname_dotcom %} in your project {% data reusables.package_registry.authenticate-step %} 2. To use a package, add `ItemGroup` and configure the `PackageReference` field in the *.csproj* project file. Replace the `PACKAGE_NAME` value in `Include="PACKAGE_NAME"` with your package dependency, and replace the `X.X.X` value in `Version="X.X.X"` with the version of the package you want to use: - ``` xml - - - - Exe - netcoreapp3.0 - My-app - 1.0.0 + ``` xml + + + + Exe + netcoreapp3.0 + My-app + 1.0.0 Octocat - GitHub + GitHub This package adds an Octocat! - https://{% ifversion fpt or ghec %}github.com{% else %}HOSTNAME{% endif %}/OWNER/REPOSITORY - + https://{% ifversion fpt or ghec %}github.com{% else %}HOSTNAME{% endif %}/OWNER/REPOSITORY + - - - + + + - - ``` + + ``` 3. Install the packages with the `restore` command. - ```shell - dotnet restore - ``` + ```shell + dotnet restore + ``` ## Troubleshooting diff --git a/content/packages/working-with-a-github-packages-registry/working-with-the-rubygems-registry.md b/content/packages/working-with-a-github-packages-registry/working-with-the-rubygems-registry.md index 547f757c75bd..de0e907a7d30 100644 --- a/content/packages/working-with-a-github-packages-registry/working-with-the-rubygems-registry.md +++ b/content/packages/working-with-a-github-packages-registry/working-with-the-rubygems-registry.md @@ -93,9 +93,9 @@ $ bundle config https://{% ifversion fpt or ghec %}rubygems.pkg.github.com{% els {% data reusables.package_registry.authenticate-step %} 1. Build the package from the *gemspec* to create the *.gem* package. Replace `GEM_NAME` with the name of your gem. - ``` - gem build GEM_NAME.gemspec - ``` + ``` + gem build GEM_NAME.gemspec + ``` 1. Publish a package to {% data variables.product.prodname_registry %}, replacing `NAMESPACE` with the name of the personal account or organization {% ifversion packages-rubygems-v2 %}to which the package will be scoped{% else %}that owns the repository containing your project{% endif %} and `GEM_NAME` with the name of your gem package.{% ifversion ghes %} Replace `REGISTRY_URL` with the URL for your instance's Rubygems registry. If your instance has subdomain isolation enabled, use `rubygems.HOSTNAME`. If your instance has subdomain isolation disabled, use `HOSTNAME/_registry/rubygems`. In either case, replace `HOSTNAME` with the host name of your {% data variables.product.prodname_ghe_server %} instance.{% elsif ghae %} Replace `REGISTRY_URL` with the URL for your instance's Rubygems registry, `rubygems.HOSTNAME`. Replace `HOSTNAME` with the hostname of {% data variables.location.product_location %}.{% endif %} {% note %} @@ -104,11 +104,11 @@ $ bundle config https://{% ifversion fpt or ghec %}rubygems.pkg.github.com{% els {% endnote %} - ``` - $ gem push --key github \ - --host https://{% ifversion fpt or ghec %}rubygems.pkg.github.com{% else %}REGISTRY_URL{% endif %}/NAMESPACE \ - GEM_NAME-0.0.1.gem - ``` + ``` + $ gem push --key github \ + --host https://{% ifversion fpt or ghec %}rubygems.pkg.github.com{% else %}REGISTRY_URL{% endif %}/NAMESPACE \ + GEM_NAME-0.0.1.gem + ``` {% ifversion packages-rubygems-v2 %} @@ -164,9 +164,9 @@ You can use gems from {% data variables.product.prodname_registry %} much like y ``` 4. Install the package: - ``` - $ gem install GEM_NAME --version "0.1.1" - ``` + ``` + $ gem install GEM_NAME --version "0.1.1" + ``` ## Further reading diff --git a/content/pages/configuring-a-custom-domain-for-your-github-pages-site/verifying-your-custom-domain-for-github-pages.md b/content/pages/configuring-a-custom-domain-for-your-github-pages-site/verifying-your-custom-domain-for-github-pages.md index bf08c4b050b5..43af01840d13 100644 --- a/content/pages/configuring-a-custom-domain-for-your-github-pages-site/verifying-your-custom-domain-for-github-pages.md +++ b/content/pages/configuring-a-custom-domain-for-your-github-pages-site/verifying-your-custom-domain-for-github-pages.md @@ -28,9 +28,9 @@ It's also possible to verify a domain for your organization{% ifversion ghec %} 1. In the "Code, planning, and automation" section of the sidebar, click **{% octicon "browser" aria-hidden="true" %} Pages**. {% data reusables.pages.settings-verify-domain-setup %} 1. Wait for your DNS configuration to change, this may be immediate or take up to 24 hours. You can confirm the change to your DNS configuration by running the `dig` command on the command line. In the command below, replace `USERNAME` with your username and `example.com` with the domain you're verifying. If your DNS configuration has updated, you should see your new TXT record in the output. - ``` - dig _github-pages-challenge-USERNAME.example.com +nostats +nocomments +nocmd TXT - ``` + ``` + dig _github-pages-challenge-USERNAME.example.com +nostats +nocomments +nocmd TXT + ``` {% data reusables.pages.settings-verify-domain-confirm %} ## Verifying a domain for your organization site @@ -42,7 +42,7 @@ Organization owners can verify custom domains for their organization. 1. In the "Code, planning, and automation" section of the sidebar, click **{% octicon "browser" aria-hidden="true" %} Pages**. {% data reusables.pages.settings-verify-domain-setup %} 1. Wait for your DNS configuration to change. This may be immediate or take up to 24 hours. You can confirm the change to your DNS configuration by running the `dig` command on the command line. In the command below, replace `ORGANIZATION` with the name of your organization and `example.com` with the domain you're verifying. If your DNS configuration has updated, you should see your new TXT record in the output. - ``` - dig _github-pages-challenge-ORGANIZATION.example.com +nostats +nocomments +nocmd TXT - ``` + ``` + dig _github-pages-challenge-ORGANIZATION.example.com +nostats +nocomments +nocmd TXT + ``` {% data reusables.pages.settings-verify-domain-confirm %} diff --git a/content/pages/getting-started-with-github-pages/creating-a-custom-404-page-for-your-github-pages-site.md b/content/pages/getting-started-with-github-pages/creating-a-custom-404-page-for-your-github-pages-site.md index 3e1891fe961d..1f6e2cfc27a3 100644 --- a/content/pages/getting-started-with-github-pages/creating-a-custom-404-page-for-your-github-pages-site.md +++ b/content/pages/getting-started-with-github-pages/creating-a-custom-404-page-for-your-github-pages-site.md @@ -21,11 +21,11 @@ shortTitle: Create custom 404 page {% data reusables.files.add-file %} 3. In the file name field, type `404.html` or `404.md`. 4. If you named your file `404.md`, add the following YAML front matter to the beginning of the file: - ```yaml - --- - permalink: /404.html - --- - ``` + ```yaml + --- + permalink: /404.html + --- + ``` 5. Below the YAML front matter, if present, add the content you want to display on your 404 page. {% data reusables.files.write_commit_message %} {% data reusables.files.choose-commit-email %} diff --git a/content/pages/setting-up-a-github-pages-site-with-jekyll/about-jekyll-build-errors-for-github-pages-sites.md b/content/pages/setting-up-a-github-pages-site-with-jekyll/about-jekyll-build-errors-for-github-pages-sites.md index 5b61d5481365..1c806342cead 100644 --- a/content/pages/setting-up-a-github-pages-site-with-jekyll/about-jekyll-build-errors-for-github-pages-sites.md +++ b/content/pages/setting-up-a-github-pages-site-with-jekyll/about-jekyll-build-errors-for-github-pages-sites.md @@ -73,16 +73,16 @@ We recommend testing your site locally, which allows you to see build error mess You can configure a third-party service, such as [Travis CI](https://travis-ci.com/), to display error messages after each commit. 1. If you haven't already, add a file called _Gemfile_ in the root of your publishing source, with the following content: - ```ruby - source `https://rubygems.org` - gem `github-pages` - ``` + ```ruby + source `https://rubygems.org` + gem `github-pages` + ``` 2. Configure your site's repository for the testing service of your choice. For example, to use [Travis CI](https://travis-ci.com/), add a file named _.travis.yml_ in the root of your publishing source, with the following content: - ```yaml - language: ruby - rvm: - - 2.3 - script: "bundle exec jekyll build" - ``` + ```yaml + language: ruby + rvm: + - 2.3 + script: "bundle exec jekyll build" + ``` 3. You may need to activate your repository with the third-party testing service. For more information, see your testing service's documentation. diff --git a/content/pages/setting-up-a-github-pages-site-with-jekyll/adding-a-theme-to-your-github-pages-site-using-jekyll.md b/content/pages/setting-up-a-github-pages-site-with-jekyll/adding-a-theme-to-your-github-pages-site-using-jekyll.md index bdf2d8235aca..d0e483c79203 100644 --- a/content/pages/setting-up-a-github-pages-site-with-jekyll/adding-a-theme-to-your-github-pages-site-using-jekyll.md +++ b/content/pages/setting-up-a-github-pages-site-with-jekyll/adding-a-theme-to-your-github-pages-site-using-jekyll.md @@ -46,12 +46,12 @@ People with write permissions for a repository can add a theme to a {% data vari {% data reusables.pages.navigate-publishing-source %} 1. Create a new file called _/assets/css/style.scss_. 2. Add the following content to the top of the file: - ```scss - --- - --- + ```scss + --- + --- - @import "{% raw %}{{ site.theme }}{% endraw %}"; - ``` + @import "{% raw %}{{ site.theme }}{% endraw %}"; + ``` 3. Add any custom CSS or Sass (including imports) you'd like immediately after the `@import` line. ## Customizing your theme's HTML layout diff --git a/content/pages/setting-up-a-github-pages-site-with-jekyll/adding-content-to-your-github-pages-site-using-jekyll.md b/content/pages/setting-up-a-github-pages-site-with-jekyll/adding-content-to-your-github-pages-site-using-jekyll.md index 7055d0b5bd66..837744dc3fb2 100644 --- a/content/pages/setting-up-a-github-pages-site-with-jekyll/adding-content-to-your-github-pages-site-using-jekyll.md +++ b/content/pages/setting-up-a-github-pages-site-with-jekyll/adding-content-to-your-github-pages-site-using-jekyll.md @@ -37,11 +37,11 @@ Your theme includes default layouts, includes, and stylesheets that will automat {% data reusables.pages.navigate-publishing-source %} 3. In the root of your publishing source, create a new file for your page called `PAGE-NAME.md`, replacing PAGE-NAME with a meaningful filename for the page. 4. Add the following YAML frontmatter to the top of the file, replacing PAGE-TITLE with the page's title and URL-PATH with a path you want for the page's URL. For example, if the base URL of your site is `https://octocat.github.io` and your URL-PATH is `/about/contact/`, your page will be located at `https://octocat.github.io/about/contact`. - ```shell - layout: page - title: "PAGE-TITLE" - permalink: /URL-PATH - ``` + ```shell + layout: page + title: "PAGE-TITLE" + permalink: /URL-PATH + ``` 5. Below the frontmatter, add content for your page. {% data reusables.files.write_commit_message %} {% data reusables.files.choose-commit-email %} @@ -60,12 +60,12 @@ Your theme includes default layouts, includes, and stylesheets that will automat 3. Navigate to the `_posts` directory. 4. Create a new file called `YYYY-MM-DD-NAME-OF-POST.md`, replacing YYYY-MM-DD with the date of your post and NAME-OF-POST with the name of your post. 5. Add the following YAML frontmatter to the top of the file, including the post's title enclosed in quotation marks, the date and time for the post in YYYY-MM-DD hh:mm:ss -0000 format, and as many categories as you want for your post. - ```shell - layout: post - title: "POST-TITLE" - date: YYYY-MM-DD hh:mm:ss -0000 - categories: CATEGORY-1 CATEGORY-2 - ``` + ```shell + layout: post + title: "POST-TITLE" + date: YYYY-MM-DD hh:mm:ss -0000 + categories: CATEGORY-1 CATEGORY-2 + ``` 5. Below the frontmatter, add content for your post. {% data reusables.files.write_commit_message %} {% data reusables.files.choose-commit-email %} diff --git a/content/pages/setting-up-a-github-pages-site-with-jekyll/creating-a-github-pages-site-with-jekyll.md b/content/pages/setting-up-a-github-pages-site-with-jekyll/creating-a-github-pages-site-with-jekyll.md index b21e40424f76..a735bec66909 100644 --- a/content/pages/setting-up-a-github-pages-site-with-jekyll/creating-a-github-pages-site-with-jekyll.md +++ b/content/pages/setting-up-a-github-pages-site-with-jekyll/creating-a-github-pages-site-with-jekyll.md @@ -44,20 +44,20 @@ Before you can use Jekyll to create a {% data variables.product.prodname_pages % {% data reusables.command_line.open_the_multi_os_terminal %} 1. If you don't already have a local copy of your repository, navigate to the location where you want to store your site's source files, replacing PARENT-FOLDER with the folder you want to contain the folder for your repository. - ```shell - $ cd PARENT-FOLDER - ``` + ```shell + $ cd PARENT-FOLDER + ``` 1. If you haven't already, initialize a local Git repository, replacing REPOSITORY-NAME with the name of your repository. - ```shell - $ git init REPOSITORY-NAME - > Initialized empty Git repository in /Users/octocat/my-site/.git/ - # Creates a new folder on your computer, initialized as a Git repository - ``` - 4. Change directories to the repository. - ```shell - $ cd REPOSITORY-NAME - # Changes the working directory - ``` + ```shell + $ git init REPOSITORY-NAME + > Initialized empty Git repository in /Users/octocat/my-site/.git/ + # Creates a new folder on your computer, initialized as a Git repository + ``` +1. Change directories to the repository. + ```shell + $ cd REPOSITORY-NAME + # Changes the working directory + ``` {% data reusables.pages.decide-publishing-source %} {% data reusables.pages.navigate-publishing-source %} For example, if you chose to publish your site from the `docs` folder on the default branch, create and change directories to the `docs` folder. diff --git a/content/pages/setting-up-a-github-pages-site-with-jekyll/testing-your-github-pages-site-locally-with-jekyll.md b/content/pages/setting-up-a-github-pages-site-with-jekyll/testing-your-github-pages-site-locally-with-jekyll.md index 01dd80c9ddb2..6fd01564cc2c 100644 --- a/content/pages/setting-up-a-github-pages-site-with-jekyll/testing-your-github-pages-site-locally-with-jekyll.md +++ b/content/pages/setting-up-a-github-pages-site-with-jekyll/testing-your-github-pages-site-locally-with-jekyll.md @@ -35,25 +35,25 @@ Before you can use Jekyll to test a site, you must: {% data reusables.pages.navigate-publishing-source %} 3. Run `bundle install`. 3. Run your Jekyll site locally. - ```shell - $ bundle exec jekyll serve - > Configuration file: /Users/octocat/my-site/_config.yml - > Source: /Users/octocat/my-site - > Destination: /Users/octocat/my-site/_site - > Incremental build: disabled. Enable with --incremental - > Generating... - > done in 0.309 seconds. - > Auto-regeneration: enabled for '/Users/octocat/my-site' - > Configuration file: /Users/octocat/my-site/_config.yml - > Server address: http://127.0.0.1:4000/ - > Server running... press ctrl-c to stop. - ``` - {% note %} + ```shell + $ bundle exec jekyll serve + > Configuration file: /Users/octocat/my-site/_config.yml + > Source: /Users/octocat/my-site + > Destination: /Users/octocat/my-site/_site + > Incremental build: disabled. Enable with --incremental + > Generating... + > done in 0.309 seconds. + > Auto-regeneration: enabled for '/Users/octocat/my-site' + > Configuration file: /Users/octocat/my-site/_config.yml + > Server address: http://127.0.0.1:4000/ + > Server running... press ctrl-c to stop. + ``` + {% note %} - **Note:** If you've installed Ruby 3.0 or later (which you may have if you installed the default version via Homebrew), you might get an error at this step. That's because these versions of Ruby no longer come with `webrick` installed. + **Note:** If you've installed Ruby 3.0 or later (which you may have if you installed the default version via Homebrew), you might get an error at this step. That's because these versions of Ruby no longer come with `webrick` installed. - To fix the error, try running `bundle add webrick`, then re-running `bundle exec jekyll serve`. - {% endnote %} + To fix the error, try running `bundle add webrick`, then re-running `bundle exec jekyll serve`. + {% endnote %} 3. To preview your site, in your web browser, navigate to `http://localhost:4000`. diff --git a/content/pull-requests/collaborating-with-pull-requests/addressing-merge-conflicts/resolving-a-merge-conflict-using-the-command-line.md b/content/pull-requests/collaborating-with-pull-requests/addressing-merge-conflicts/resolving-a-merge-conflict-using-the-command-line.md index a101862e1160..c389a4363ef3 100644 --- a/content/pull-requests/collaborating-with-pull-requests/addressing-merge-conflicts/resolving-a-merge-conflict-using-the-command-line.md +++ b/content/pull-requests/collaborating-with-pull-requests/addressing-merge-conflicts/resolving-a-merge-conflict-using-the-command-line.md @@ -32,47 +32,47 @@ For example, if you and another person both edited the file _styleguide.md_ on t {% data reusables.command_line.open_the_multi_os_terminal %} 2. Navigate into the local Git repository that has the merge conflict. - ```shell - cd REPOSITORY-NAME - ``` + ```shell + cd REPOSITORY-NAME + ``` 3. Generate a list of the files affected by the merge conflict. In this example, the file *styleguide.md* has a merge conflict. - ```shell - $ git status - > # On branch branch-b - > # You have unmerged paths. - > # (fix conflicts and run "git commit") - > # - > # Unmerged paths: - > # (use "git add ..." to mark resolution) - > # - > # both modified: styleguide.md - > # - > no changes added to commit (use "git add" and/or "git commit -a") - ``` + ```shell + $ git status + > # On branch branch-b + > # You have unmerged paths. + > # (fix conflicts and run "git commit") + > # + > # Unmerged paths: + > # (use "git add ..." to mark resolution) + > # + > # both modified: styleguide.md + > # + > no changes added to commit (use "git add" and/or "git commit -a") + ``` 4. Open your favorite text editor, such as [{% data variables.product.prodname_vscode %}](https://code.visualstudio.com/), and navigate to the file that has merge conflicts. 5. To see the beginning of the merge conflict in your file, search the file for the conflict marker `<<<<<<<`. When you open the file in your text editor, you'll see the changes from the HEAD or base branch after the line `<<<<<<< HEAD`. Next, you'll see `=======`, which divides your changes from the changes in the other branch, followed by `>>>>>>> BRANCH-NAME`. In this example, one person wrote "open an issue" in the base or HEAD branch and another person wrote "ask your question in IRC" in the compare branch or `branch-a`. - ``` - If you have questions, please - <<<<<<< HEAD - open an issue - ======= - ask your question in IRC. - >>>>>>> branch-a - ``` + ``` + If you have questions, please + <<<<<<< HEAD + open an issue + ======= + ask your question in IRC. + >>>>>>> branch-a + ``` {% data reusables.pull_requests.decide-how-to-resolve-competing-line-change-merge-conflict %} In this example, both changes are incorporated into the final merge: ```shell If you have questions, please open an issue or ask in our IRC channel if it's more urgent. ``` 7. Add or stage your changes. - ```shell - $ git add . - ``` + ```shell + $ git add . + ``` 8. Commit your changes with a comment. - ```shell - $ git commit -m "Resolved merge conflict by incorporating both suggestions." - ``` + ```shell + $ git commit -m "Resolved merge conflict by incorporating both suggestions." + ``` You can now merge the branches on the command line or [push your changes to your remote repository](/get-started/using-git/pushing-commits-to-a-remote-repository) on {% data variables.product.product_name %} and [merge your changes](/pull-requests/collaborating-with-pull-requests/incorporating-changes-from-a-pull-request/merging-a-pull-request) in a pull request. @@ -84,44 +84,44 @@ For example, if you edited a file, such as *README.md*, and another person remov {% data reusables.command_line.open_the_multi_os_terminal %} 2. Navigate into the local Git repository that has the merge conflict. - ```shell - cd REPOSITORY-NAME - ``` + ```shell + cd REPOSITORY-NAME + ``` 2. Generate a list of the files affected by the merge conflict. In this example, the file *README.md* has a merge conflict. - ```shell - $ git status - > # On branch main - > # Your branch and 'origin/main' have diverged, - > # and have 1 and 2 different commits each, respectively. - > # (use "git pull" to merge the remote branch into yours) - > # You have unmerged paths. - > # (fix conflicts and run "git commit") - > # - > # Unmerged paths: - > # (use "git add/rm ..." as appropriate to mark resolution) - > # - > # deleted by us: README.md - > # - > # no changes added to commit (use "git add" and/or "git commit -a") - ``` + ```shell + $ git status + > # On branch main + > # Your branch and 'origin/main' have diverged, + > # and have 1 and 2 different commits each, respectively. + > # (use "git pull" to merge the remote branch into yours) + > # You have unmerged paths. + > # (fix conflicts and run "git commit") + > # + > # Unmerged paths: + > # (use "git add/rm ..." as appropriate to mark resolution) + > # + > # deleted by us: README.md + > # + > # no changes added to commit (use "git add" and/or "git commit -a") + ``` 3. Open your favorite text editor, such as [{% data variables.product.prodname_vscode %}](https://code.visualstudio.com/), and navigate to the file that has merge conflicts. 6. Decide if you want keep the removed file. You may want to view the latest changes made to the removed file in your text editor. - To add the removed file back to your repository: - ```shell - $ git add README.md - ``` - To remove this file from your repository: - ```shell - $ git rm README.md - > README.md: needs merge - > rm 'README.md' - ``` + To add the removed file back to your repository: + ```shell + $ git add README.md + ``` + To remove this file from your repository: + ```shell + $ git rm README.md + > README.md: needs merge + > rm 'README.md' + ``` 7. Commit your changes with a comment. - ```shell - $ git commit -m "Resolved merge conflict by keeping README.md file." - > [branch-d 6f89e49] Merge branch 'branch-c' into branch-d - ``` + ```shell + $ git commit -m "Resolved merge conflict by keeping README.md file." + > [branch-d 6f89e49] Merge branch 'branch-c' into branch-d + ``` You can now merge the branches on the command line or [push your changes to your remote repository](/get-started/using-git/pushing-commits-to-a-remote-repository) on {% data variables.product.product_name %} and [merge your changes](/pull-requests/collaborating-with-pull-requests/incorporating-changes-from-a-pull-request/merging-a-pull-request) in a pull request. diff --git a/content/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/committing-changes-to-a-pull-request-branch-created-from-a-fork.md b/content/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/committing-changes-to-a-pull-request-branch-created-from-a-fork.md index 52cf89cbe1d1..20c84908d90e 100644 --- a/content/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/committing-changes-to-a-pull-request-branch-created-from-a-fork.md +++ b/content/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/committing-changes-to-a-pull-request-branch-created-from-a-fork.md @@ -38,55 +38,55 @@ Only the user who created the pull request can give you permission to push commi {% endtip %} 4. Change the current working directory to the location where you want to download the cloned directory. - ```shell - $ cd open-source-projects - ``` + ```shell + $ cd open-source-projects + ``` 5. Type `git clone`, and then paste the URL you copied in Step 3. - ```shell - $ git clone https://{% data variables.command_line.codeblock %}/USERNAME/FORK-OF-THE-REPOSITORY - ``` + ```shell + $ git clone https://{% data variables.command_line.codeblock %}/USERNAME/FORK-OF-THE-REPOSITORY + ``` 6. Press **Enter**. Your local clone will be created. - ```shell - $ git clone https://{% data variables.command_line.codeblock %}/USERNAME/FORK-OF-THE-REPOSITORY - > Cloning into `FORK-OF-THE-REPOSITORY`... - > remote: Counting objects: 10, done. - > remote: Compressing objects: 100% (8/8), done. - > remove: Total 10 (delta 1), reused 10 (delta 1) - > Unpacking objects: 100% (10/10), done. - ``` - {% tip %} - - **Tip:** The error message "fatal: destination path 'REPOSITORY-NAME' already exists and is not an empty directory" means that your current working directory already contains a repository with the same name. To resolve the error, you must clone the fork in a different directory. - - {% endtip %} + ```shell + $ git clone https://{% data variables.command_line.codeblock %}/USERNAME/FORK-OF-THE-REPOSITORY + > Cloning into `FORK-OF-THE-REPOSITORY`... + > remote: Counting objects: 10, done. + > remote: Compressing objects: 100% (8/8), done. + > remove: Total 10 (delta 1), reused 10 (delta 1) + > Unpacking objects: 100% (10/10), done. + ``` + {% tip %} + + **Tip:** The error message "fatal: destination path 'REPOSITORY-NAME' already exists and is not an empty directory" means that your current working directory already contains a repository with the same name. To resolve the error, you must clone the fork in a different directory. + + {% endtip %} 7. Navigate into your new cloned repository. - ```shell - $ cd FORK-OF-THE-REPOSITORY - ``` + ```shell + $ cd FORK-OF-THE-REPOSITORY + ``` 7. Switch branches to the compare branch of the pull request where the original changes were made. If you navigate to the original pull request, you'll see the compare branch at the top of the pull request. - In this example, the compare branch is `test-branch`: - ```shell - $ git checkout TEST-BRANCH - ``` + In this example, the compare branch is `test-branch`: + ```shell + $ git checkout TEST-BRANCH + ``` - {% tip %} + {% tip %} - **Tip:** For more information about pull request branches, including examples, see "[AUTOTITLE](/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request#changing-the-branch-range-and-destination-repository)." + **Tip:** For more information about pull request branches, including examples, see "[AUTOTITLE](/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request#changing-the-branch-range-and-destination-repository)." - {% endtip %} + {% endtip %} 8. At this point, you can do anything you want with this branch. You can push new commits to it, run some local tests, or merge other branches into the branch. Make modifications as you like. 9. After you commit your changes to the head branch of the pull request you can push your changes up to the original pull request directly. In this example, the head branch is `test-branch`: - ```shell - $ git push origin test-branch - > Counting objects: 32, done. - > Delta compression using up to 8 threads. - > Compressing objects: 100% (26/26), done. - > Writing objects: 100% (29/29), 74.94 KiB | 0 bytes/s, done. - > Total 29 (delta 8), reused 0 (delta 0) - > To https://{% data variables.command_line.codeblock %}/USERNAME/FORK-OF-THE-REPOSITORY.git - > 12da2e9..250e946 TEST-BRANCH -> TEST-BRANCH - ``` + ```shell + $ git push origin test-branch + > Counting objects: 32, done. + > Delta compression using up to 8 threads. + > Compressing objects: 100% (26/26), done. + > Writing objects: 100% (29/29), 74.94 KiB | 0 bytes/s, done. + > Total 29 (delta 8), reused 0 (delta 0) + > To https://{% data variables.command_line.codeblock %}/USERNAME/FORK-OF-THE-REPOSITORY.git + > 12da2e9..250e946 TEST-BRANCH -> TEST-BRANCH + ``` Your new commits will be reflected on the original pull request on {% data variables.location.product_location %}. diff --git a/content/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally.md b/content/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally.md index d2d728386e18..24adacc593a8 100644 --- a/content/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally.md +++ b/content/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally.md @@ -70,26 +70,26 @@ Anyone can work with a previously opened pull request to continue working on it, {% data reusables.command_line.open_the_multi_os_terminal %} 5. Fetch the reference to the pull request based on its ID number, creating a new branch in the process. - ```shell - $ git fetch origin pull/ID/head:BRANCH_NAME - ``` + ```shell + $ git fetch origin pull/ID/head:BRANCH_NAME + ``` 6. Switch to the new branch that's based on this pull request: - ```shell - [main] $ git checkout BRANCH_NAME - > Switched to a new branch 'BRANCH_NAME' - ``` + ```shell + [main] $ git checkout BRANCH_NAME + > Switched to a new branch 'BRANCH_NAME' + ``` 7. At this point, you can do anything you want with this branch. You can run some local tests, or merge other branches into the branch. 8. When you're ready, you can push the new branch up: - ```shell - [pull-inactive-pull-request] $ git push origin BRANCH_NAME - > Counting objects: 32, done. - > Delta compression using up to 8 threads. - > Compressing objects: 100% (26/26), done. - > Writing objects: 100% (29/29), 74.94 KiB | 0 bytes/s, done. - > Total 29 (delta 8), reused 0 (delta 0) - > To https://{% data variables.command_line.codeblock %}/USERNAME/REPOSITORY.git - > * [new branch] BRANCH_NAME -> BRANCH_NAME - ``` + ```shell + [pull-inactive-pull-request] $ git push origin BRANCH_NAME + > Counting objects: 32, done. + > Delta compression using up to 8 threads. + > Compressing objects: 100% (26/26), done. + > Writing objects: 100% (29/29), 74.94 KiB | 0 bytes/s, done. + > Total 29 (delta 8), reused 0 (delta 0) + > To https://{% data variables.command_line.codeblock %}/USERNAME/REPOSITORY.git + > * [new branch] BRANCH_NAME -> BRANCH_NAME + ``` 9. [Create a new pull request](/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request) with your new branch. ## Error: Failed to push some refs diff --git a/content/pull-requests/collaborating-with-pull-requests/working-with-forks/configuring-a-remote-repository-for-a-fork.md b/content/pull-requests/collaborating-with-pull-requests/working-with-forks/configuring-a-remote-repository-for-a-fork.md index 1843a02b83d5..a94a8a4dd6e0 100644 --- a/content/pull-requests/collaborating-with-pull-requests/working-with-forks/configuring-a-remote-repository-for-a-fork.md +++ b/content/pull-requests/collaborating-with-pull-requests/working-with-forks/configuring-a-remote-repository-for-a-fork.md @@ -18,20 +18,20 @@ shortTitle: Configure a remote repository --- {% data reusables.command_line.open_the_multi_os_terminal %} 2. List the current configured remote repository for your fork. - ```shell - $ git remote -v - > origin https://{% data variables.command_line.codeblock %}/YOUR_USERNAME/YOUR_FORK.git (fetch) - > origin https://{% data variables.command_line.codeblock %}/YOUR_USERNAME/YOUR_FORK.git (push) + ```shell + $ git remote -v + > origin https://{% data variables.command_line.codeblock %}/YOUR_USERNAME/YOUR_FORK.git (fetch) + > origin https://{% data variables.command_line.codeblock %}/YOUR_USERNAME/YOUR_FORK.git (push) ``` 3. Specify a new remote *upstream* repository that will be synced with the fork. - ```shell - $ git remote add upstream https://{% data variables.command_line.codeblock %}/ORIGINAL_OWNER/ORIGINAL_REPOSITORY.git - ``` + ```shell + $ git remote add upstream https://{% data variables.command_line.codeblock %}/ORIGINAL_OWNER/ORIGINAL_REPOSITORY.git + ``` 4. Verify the new upstream repository you've specified for your fork. - ```shell - $ git remote -v - > origin https://{% data variables.command_line.codeblock %}/YOUR_USERNAME/YOUR_FORK.git (fetch) - > origin https://{% data variables.command_line.codeblock %}/YOUR_USERNAME/YOUR_FORK.git (push) - > upstream https://{% data variables.command_line.codeblock %}/ORIGINAL_OWNER/ORIGINAL_REPOSITORY.git (fetch) - > upstream https://{% data variables.command_line.codeblock %}/ORIGINAL_OWNER/ORIGINAL_REPOSITORY.git (push) - ``` + ```shell + $ git remote -v + > origin https://{% data variables.command_line.codeblock %}/YOUR_USERNAME/YOUR_FORK.git (fetch) + > origin https://{% data variables.command_line.codeblock %}/YOUR_USERNAME/YOUR_FORK.git (push) + > upstream https://{% data variables.command_line.codeblock %}/ORIGINAL_OWNER/ORIGINAL_REPOSITORY.git (fetch) + > upstream https://{% data variables.command_line.codeblock %}/ORIGINAL_OWNER/ORIGINAL_REPOSITORY.git (push) + ``` diff --git a/content/pull-requests/committing-changes-to-your-project/creating-and-editing-commits/changing-a-commit-message.md b/content/pull-requests/committing-changes-to-your-project/creating-and-editing-commits/changing-a-commit-message.md index 43cc9db9af6b..dc8b8e292914 100644 --- a/content/pull-requests/committing-changes-to-your-project/creating-and-editing-commits/changing-a-commit-message.md +++ b/content/pull-requests/committing-changes-to-your-project/creating-and-editing-commits/changing-a-commit-message.md @@ -52,9 +52,9 @@ We strongly discourage force pushing, since this changes the history of your rep 1. Follow the [steps above](/pull-requests/committing-changes-to-your-project/creating-and-editing-commits/changing-a-commit-message#commit-has-not-been-pushed-online) to amend the commit message. 2. Use the `push --force-with-lease` command to force push over the old commit. - ```shell - $ git push --force-with-lease origin EXAMPLE-BRANCH - ``` + ```shell + $ git push --force-with-lease origin EXAMPLE-BRANCH + ``` **Changing the message of older or multiple commit messages** @@ -63,47 +63,47 @@ If you need to amend the message for multiple commits or an older commit, you ca 1. On the command line, navigate to the repository that contains the commit you want to amend. 2. Use the `git rebase -i HEAD~n` command to display a list of the last `n` commits in your default text editor. - ```shell - # Displays a list of the last 3 commits on the current branch - $ git rebase -i HEAD~3 - ``` - The list will look similar to the following: - - ```shell - pick e499d89 Delete CNAME - pick 0c39034 Better README - pick f7fde4a Change the commit message but push the same commit. - - # Rebase 9fdb3bd..f7fde4a onto 9fdb3bd - # - # Commands: - # p, pick = use commit - # r, reword = use commit, but edit the commit message - # e, edit = use commit, but stop for amending - # s, squash = use commit, but meld into previous commit - # f, fixup = like "squash", but discard this commit's log message - # x, exec = run command (the rest of the line) using shell - # - # These lines can be re-ordered; they are executed from top to bottom. - # - # If you remove a line here THAT COMMIT WILL BE LOST. - # - # However, if you remove everything, the rebase will be aborted. - # - # Note that empty commits are commented out - ``` + ```shell + # Displays a list of the last 3 commits on the current branch + $ git rebase -i HEAD~3 + ``` + The list will look similar to the following: + + ```shell + pick e499d89 Delete CNAME + pick 0c39034 Better README + pick f7fde4a Change the commit message but push the same commit. + + # Rebase 9fdb3bd..f7fde4a onto 9fdb3bd + # + # Commands: + # p, pick = use commit + # r, reword = use commit, but edit the commit message + # e, edit = use commit, but stop for amending + # s, squash = use commit, but meld into previous commit + # f, fixup = like "squash", but discard this commit's log message + # x, exec = run command (the rest of the line) using shell + # + # These lines can be re-ordered; they are executed from top to bottom. + # + # If you remove a line here THAT COMMIT WILL BE LOST. + # + # However, if you remove everything, the rebase will be aborted. + # + # Note that empty commits are commented out + ``` 3. Replace `pick` with `reword` before each commit message you want to change. - ```shell - pick e499d89 Delete CNAME - reword 0c39034 Better README - reword f7fde4a Change the commit message but push the same commit. - ``` + ```shell + pick e499d89 Delete CNAME + reword 0c39034 Better README + reword f7fde4a Change the commit message but push the same commit. + ``` 4. Save and close the commit list file. 5. In each resulting commit file, type the new commit message, save the file, and close it. 6. When you're ready to push your changes to GitHub, use the push --force command to force push over the old commit. -```shell -$ git push --force origin EXAMPLE-BRANCH -``` + ```shell + $ git push --force origin EXAMPLE-BRANCH + ``` For more information on interactive rebase, see "[Interactive mode](https://git-scm.com/docs/git-rebase#_interactive_mode)" in the Git manual. diff --git a/content/pull-requests/committing-changes-to-your-project/creating-and-editing-commits/creating-a-commit-on-behalf-of-an-organization.md b/content/pull-requests/committing-changes-to-your-project/creating-and-editing-commits/creating-a-commit-on-behalf-of-an-organization.md index 8b77dcd95b26..28ca3138761f 100644 --- a/content/pull-requests/committing-changes-to-your-project/creating-and-editing-commits/creating-a-commit-on-behalf-of-an-organization.md +++ b/content/pull-requests/committing-changes-to-your-project/creating-and-editing-commits/creating-a-commit-on-behalf-of-an-organization.md @@ -30,11 +30,11 @@ Organizations can use the `name@organization.com` email as a public point of con ## Creating commits with an `on-behalf-of` badge on the command line 1. Type your commit message and a short, meaningful description of your changes. After your commit description, instead of a closing quotation, add two empty lines. - ```shell - $ git commit -m "Refactor usability tests. - > - > - ``` + ```shell + $ git commit -m "Refactor usability tests. + > + > + ``` {% tip %} **Tip:** If you're using a text editor on the command line to type your commit message, ensure there are two newlines between the end of your commit description and the `on-behalf-of:` commit trailer. diff --git a/content/pull-requests/committing-changes-to-your-project/creating-and-editing-commits/creating-a-commit-with-multiple-authors.md b/content/pull-requests/committing-changes-to-your-project/creating-and-editing-commits/creating-a-commit-with-multiple-authors.md index 12a70d93e958..1f042b5ecb0f 100644 --- a/content/pull-requests/committing-changes-to-your-project/creating-and-editing-commits/creating-a-commit-with-multiple-authors.md +++ b/content/pull-requests/committing-changes-to-your-project/creating-and-editing-commits/creating-a-commit-with-multiple-authors.md @@ -41,11 +41,11 @@ You can use {% data variables.product.prodname_desktop %} to create a commit wit {% data reusables.pull_requests.collect-co-author-commit-git-config-info %} 1. Type your commit message and a short, meaningful description of your changes. After your commit description, instead of a closing quotation, add two empty lines. - ``` - $ git commit -m "Refactor usability tests. - > - > - ``` + ``` + $ git commit -m "Refactor usability tests. + > + > + ``` {% tip %} **Tip:** If you're using a text editor on the command line to type your commit message, ensure there are two newlines between the end of your commit description and the `Co-authored-by:` commit trailer. @@ -54,14 +54,14 @@ You can use {% data variables.product.prodname_desktop %} to create a commit wit 3. On the next line of the commit message, type `Co-authored-by: name ` with specific information for each co-author. After the co-author information, add a closing quotation mark. - If you're adding multiple co-authors, give each co-author their own line and `Co-authored-by:` commit trailer. - ``` - $ git commit -m "Refactor usability tests. - > - > - Co-authored-by: NAME - Co-authored-by: ANOTHER-NAME " - ``` + If you're adding multiple co-authors, give each co-author their own line and `Co-authored-by:` commit trailer. + ``` + $ git commit -m "Refactor usability tests. + > + > + Co-authored-by: NAME + Co-authored-by: ANOTHER-NAME " + ``` The new commit and message will appear on {% data variables.location.product_location %} the next time you push. For more information, see "[AUTOTITLE](/get-started/using-git/pushing-commits-to-a-remote-repository)." diff --git a/content/repositories/creating-and-managing-repositories/duplicating-a-repository.md b/content/repositories/creating-and-managing-repositories/duplicating-a-repository.md index d7a2a5b090ee..c768eb2556af 100644 --- a/content/repositories/creating-and-managing-repositories/duplicating-a-repository.md +++ b/content/repositories/creating-and-managing-repositories/duplicating-a-repository.md @@ -30,48 +30,48 @@ Before you can push the original repository to your new copy, or _mirror_, of th {% data reusables.command_line.open_the_multi_os_terminal %} 2. Create a bare clone of the repository. - ```shell - $ git clone --bare https://{% data variables.command_line.codeblock %}/EXAMPLE-USER/OLD-REPOSITORY.git - ``` + ```shell + $ git clone --bare https://{% data variables.command_line.codeblock %}/EXAMPLE-USER/OLD-REPOSITORY.git + ``` 3. Mirror-push to the new repository. - ```shell - $ cd OLD-REPOSITORY.git - $ git push --mirror https://{% data variables.command_line.codeblock %}/EXAMPLE-USER/NEW-REPOSITORY.git - ``` + ```shell + $ cd OLD-REPOSITORY.git + $ git push --mirror https://{% data variables.command_line.codeblock %}/EXAMPLE-USER/NEW-REPOSITORY.git + ``` 4. Remove the temporary local repository you created earlier. - ```shell - $ cd .. - $ rm -rf OLD-REPOSITORY.git - ``` + ```shell + $ cd .. + $ rm -rf OLD-REPOSITORY.git + ``` ## Mirroring a repository that contains {% data variables.large_files.product_name_long %} objects {% data reusables.command_line.open_the_multi_os_terminal %} 2. Create a bare clone of the repository. Replace the example username with the name of the person or organization who owns the repository, and replace the example repository name with the name of the repository you'd like to duplicate. - ```shell - $ git clone --bare https://{% data variables.command_line.codeblock %}/EXAMPLE-USER/OLD-REPOSITORY.git - ``` + ```shell + $ git clone --bare https://{% data variables.command_line.codeblock %}/EXAMPLE-USER/OLD-REPOSITORY.git + ``` 3. Navigate to the repository you just cloned. - ```shell - $ cd OLD-REPOSITORY.git - ``` + ```shell + $ cd OLD-REPOSITORY.git + ``` 4. Pull in the repository's {% data variables.large_files.product_name_long %} objects. - ```shell - $ git lfs fetch --all - ``` + ```shell + $ git lfs fetch --all + ``` 5. Mirror-push to the new repository. - ```shell - $ git push --mirror https://{% data variables.command_line.codeblock %}/EXAMPLE-USER/NEW-REPOSITORY.git - ``` + ```shell + $ git push --mirror https://{% data variables.command_line.codeblock %}/EXAMPLE-USER/NEW-REPOSITORY.git + ``` 6. Push the repository's {% data variables.large_files.product_name_long %} objects to your mirror. - ```shell - $ git lfs push --all https://github.com/EXAMPLE-USER/NEW-REPOSITORY.git - ``` + ```shell + $ git lfs push --all https://github.com/EXAMPLE-USER/NEW-REPOSITORY.git + ``` 7. Remove the temporary local repository you created earlier. - ```shell - $ cd .. - $ rm -rf OLD-REPOSITORY.git - ``` + ```shell + $ cd .. + $ rm -rf OLD-REPOSITORY.git + ``` ## Mirroring a repository in another location @@ -79,21 +79,21 @@ If you want to mirror a repository in another location, including getting update {% data reusables.command_line.open_the_multi_os_terminal %} 2. Create a bare mirrored clone of the repository. - ```shell - $ git clone --mirror https://{% data variables.command_line.codeblock %}/EXAMPLE-USER/REPOSITORY-TO-MIRROR.git - ``` + ```shell + $ git clone --mirror https://{% data variables.command_line.codeblock %}/EXAMPLE-USER/REPOSITORY-TO-MIRROR.git + ``` 3. Set the push location to your mirror. - ```shell - $ cd REPOSITORY-TO-MIRROR - $ git remote set-url --push origin https://{% data variables.command_line.codeblock %}/EXAMPLE-USER/MIRRORED - ``` + ```shell + $ cd REPOSITORY-TO-MIRROR + $ git remote set-url --push origin https://{% data variables.command_line.codeblock %}/EXAMPLE-USER/MIRRORED + ``` As with a bare clone, a mirrored clone includes all remote branches and tags, but all local references will be overwritten each time you fetch, so it will always be the same as the original repository. Setting the URL for pushes simplifies pushing to your mirror. 4. To update your mirror, fetch updates and push. - ```shell - $ git fetch -p origin - $ git push --mirror - ``` + ```shell + $ git fetch -p origin + $ git push --mirror + ``` {% ifversion fpt or ghec %} ## Further reading diff --git a/content/repositories/working-with-files/managing-files/moving-a-file-to-a-new-location.md b/content/repositories/working-with-files/managing-files/moving-a-file-to-a-new-location.md index d968e8c5c381..71b642e1769b 100644 --- a/content/repositories/working-with-files/managing-files/moving-a-file-to-a-new-location.md +++ b/content/repositories/working-with-files/managing-files/moving-a-file-to-a-new-location.md @@ -51,42 +51,42 @@ Many files can be [moved directly on {% data variables.product.product_name %}]( 1. On your computer, move the file to a new location within the directory that was created locally on your computer when you cloned the repository. {% data reusables.command_line.open_the_multi_os_terminal %} 3. Use `git status` to check the old and new file locations. - ```shell - $ git status - > # On branch YOUR-BRANCH - > # Changes not staged for commit: - > # (use "git add/rm ..." to update what will be committed) - > # (use "git checkout -- ..." to discard changes in working directory) - > # - > # deleted: /OLD-FOLDER/IMAGE.PNG - > # - > # Untracked files: - > # (use "git add ..." to include in what will be committed) - > # - > # /NEW-FOLDER/IMAGE.PNG - > # - > # no changes added to commit (use "git add" and/or "git commit -a") - ``` + ```shell + $ git status + > # On branch YOUR-BRANCH + > # Changes not staged for commit: + > # (use "git add/rm ..." to update what will be committed) + > # (use "git checkout -- ..." to discard changes in working directory) + > # + > # deleted: /OLD-FOLDER/IMAGE.PNG + > # + > # Untracked files: + > # (use "git add ..." to include in what will be committed) + > # + > # /NEW-FOLDER/IMAGE.PNG + > # + > # no changes added to commit (use "git add" and/or "git commit -a") + ``` {% data reusables.git.stage_for_commit %} This will delete, or `git rm`, the file from the old location and add, or `git add`, the file to the new location. - ```shell - $ git add . - # Adds the file to your local repository and stages it for commit. - # {% data reusables.git.unstage-codeblock %} - ``` + ```shell + $ git add . + # Adds the file to your local repository and stages it for commit. + # {% data reusables.git.unstage-codeblock %} + ``` 5. Use `git status` to check the changes staged for commit. - ```shell - $ git status - > # On branch YOUR-BRANCH - > # Changes to be committed: - > # (use "git reset HEAD ..." to unstage) - > # - > # renamed: /old-folder/image.png -> /new-folder/image.png - # Displays the changes staged for commit - ``` + ```shell + $ git status + > # On branch YOUR-BRANCH + > # Changes to be committed: + > # (use "git reset HEAD ..." to unstage) + > # + > # renamed: /old-folder/image.png -> /new-folder/image.png + # Displays the changes staged for commit + ``` {% data reusables.git.commit-file %} - ```shell - $ git commit -m "Move file to new directory" - # Commits the tracked changes and prepares them to be pushed to a remote repository. - # {% data reusables.git.reset-head-to-previous-commit-codeblock %} - ``` + ```shell + $ git commit -m "Move file to new directory" + # Commits the tracked changes and prepares them to be pushed to a remote repository. + # {% data reusables.git.reset-head-to-previous-commit-codeblock %} + ``` {% data reusables.git.git-push %} diff --git a/content/repositories/working-with-files/managing-files/renaming-a-file.md b/content/repositories/working-with-files/managing-files/renaming-a-file.md index 9e315c793324..2d69b1a1a05f 100644 --- a/content/repositories/working-with-files/managing-files/renaming-a-file.md +++ b/content/repositories/working-with-files/managing-files/renaming-a-file.md @@ -51,23 +51,23 @@ Many files can be [renamed directly on {% data variables.product.product_name %} {% data reusables.command_line.open_the_multi_os_terminal %} {% data reusables.command_line.switching_directories_procedural %} 3. Rename the file, specifying the old file name and the new name you'd like to give the file. This will stage your change for commit. - ```shell - $ git mv OLD-FILENAME NEW-FILENAME - ``` + ```shell + $ git mv OLD-FILENAME NEW-FILENAME + ``` 4. Use `git status` to check the old and new file names. - ```shell - $ git status - > # On branch YOUR-BRANCH - > # Changes to be committed: - > # (use "git reset HEAD ..." to unstage) - > # - > # renamed: OLD-FILENAME -> NEW-FILENAME - > # - ``` + ```shell + $ git status + > # On branch YOUR-BRANCH + > # Changes to be committed: + > # (use "git reset HEAD ..." to unstage) + > # + > # renamed: OLD-FILENAME -> NEW-FILENAME + > # + ``` {% data reusables.git.commit-file %} - ```shell - $ git commit -m "Rename file" - # Commits the tracked changes and prepares them to be pushed to a remote repository. - # {% data reusables.git.reset-head-to-previous-commit-codeblock %} - ``` + ```shell + $ git commit -m "Rename file" + # Commits the tracked changes and prepares them to be pushed to a remote repository. + # {% data reusables.git.reset-head-to-previous-commit-codeblock %} + ``` {% data reusables.git.git-push %} diff --git a/content/repositories/working-with-files/managing-large-files/about-large-files-on-github.md b/content/repositories/working-with-files/managing-large-files/about-large-files-on-github.md index 3cce41ea88ce..3f93b0deccc4 100644 --- a/content/repositories/working-with-files/managing-large-files/about-large-files-on-github.md +++ b/content/repositories/working-with-files/managing-large-files/about-large-files-on-github.md @@ -79,22 +79,22 @@ If the file was added with your most recent commit, and you have not pushed to { {% data reusables.command_line.open_the_multi_os_terminal %} {% data reusables.command_line.switching_directories_procedural %} 3. To remove the file, enter `git rm --cached`: - ```shell - $ git rm --cached GIANT_FILE - # Stage our giant file for removal, but leave it on disk - ``` + ```shell + $ git rm --cached GIANT_FILE + # Stage our giant file for removal, but leave it on disk + ``` 4. Commit this change using `--amend -CHEAD`: - ```shell - $ git commit --amend -CHEAD - # Amend the previous commit with your change - # Simply making a new commit won't work, as you need - # to remove the file from the unpushed history as well - ``` + ```shell + $ git commit --amend -CHEAD + # Amend the previous commit with your change + # Simply making a new commit won't work, as you need + # to remove the file from the unpushed history as well + ``` 5. Push your commits to {% data variables.location.product_location %}: - ```shell - $ git push - # Push our rewritten, smaller commit - ``` + ```shell + $ git push + # Push our rewritten, smaller commit + ``` ### Removing a file that was added in an earlier commit diff --git a/content/repositories/working-with-files/managing-large-files/configuring-git-large-file-storage.md b/content/repositories/working-with-files/managing-large-files/configuring-git-large-file-storage.md index 4f8a2fd4c8ce..aad9d6c3950b 100644 --- a/content/repositories/working-with-files/managing-large-files/configuring-git-large-file-storage.md +++ b/content/repositories/working-with-files/managing-large-files/configuring-git-large-file-storage.md @@ -49,20 +49,20 @@ If there are existing files in your repository that you'd like to use {% data va {% endnote %} 4. Add a file to the repository matching the extension you've associated: - ```shell - $ git add path/to/file.psd - ``` + ```shell + $ git add path/to/file.psd + ``` 5. Commit the file and push it to {% data variables.product.product_name %}: - ```shell - $ git commit -m "add file.psd" - $ git push - ``` - You should see some diagnostic information about your file upload: - ```shell - > Sending file.psd - > 44.74 MB / 81.04 MB 55.21 % 14s - > 64.74 MB / 81.04 MB 79.21 % 3s - ``` + ```shell + $ git commit -m "add file.psd" + $ git push + ``` + You should see some diagnostic information about your file upload: + ```shell + > Sending file.psd + > 44.74 MB / 81.04 MB 55.21 % 14s + > 64.74 MB / 81.04 MB 79.21 % 3s + ``` ## Further reading diff --git a/content/repositories/working-with-files/managing-large-files/installing-git-large-file-storage.md b/content/repositories/working-with-files/managing-large-files/installing-git-large-file-storage.md index 608a38cb66d6..bee78fdc56c6 100644 --- a/content/repositories/working-with-files/managing-large-files/installing-git-large-file-storage.md +++ b/content/repositories/working-with-files/managing-large-files/installing-git-large-file-storage.md @@ -24,29 +24,29 @@ shortTitle: Install Git LFS 2. On your computer, locate and unzip the downloaded file. {% data reusables.command_line.open_the_multi_os_terminal %} 3. Change the current working directory into the folder you downloaded and unzipped. - ```shell - $ cd ~/Downloads/git-lfs-1.X.X - ``` - {% note %} + ```shell + $ cd ~/Downloads/git-lfs-1.X.X + ``` + {% note %} - **Note:** The file path you use after `cd` depends on your operating system, Git LFS version you downloaded, and where you saved the {% data variables.large_files.product_name_short %} download. + **Note:** The file path you use after `cd` depends on your operating system, Git LFS version you downloaded, and where you saved the {% data variables.large_files.product_name_short %} download. - {% endnote %} + {% endnote %} 4. To install the file, run this command: - ```shell - $ ./install.sh - > {% data variables.large_files.product_name_short %} initialized. - ``` - {% note %} + ```shell + $ ./install.sh + > {% data variables.large_files.product_name_short %} initialized. + ``` + {% note %} - **Note:** You may have to use `sudo ./install.sh` to install the file. + **Note:** You may have to use `sudo ./install.sh` to install the file. - {% endnote %} + {% endnote %} 5. Verify that the installation was successful: - ```shell - $ git {% data variables.large_files.command_name %} install - > {% data variables.large_files.product_name_short %} initialized. - ``` + ```shell + $ git {% data variables.large_files.command_name %} install + > {% data variables.large_files.product_name_short %} initialized. + ``` 6. If you don't see a message indicating that `git {% data variables.large_files.command_name %} install` was successful, please contact {% data variables.contact.contact_support %}. Be sure to include the name of your operating system. {% endmac %} @@ -64,10 +64,10 @@ shortTitle: Install Git LFS 3. Double click on the file called *git-lfs-windows-1.X.X.exe*, where 1.X.X is replaced with the Git LFS version you downloaded. When you open this file Windows will run a setup wizard to install {% data variables.large_files.product_name_short %}. {% data reusables.command_line.open_the_multi_os_terminal %} 5. Verify that the installation was successful: - ```shell - $ git {% data variables.large_files.command_name %} install - > {% data variables.large_files.product_name_short %} initialized. - ``` + ```shell + $ git {% data variables.large_files.command_name %} install + > {% data variables.large_files.product_name_short %} initialized. + ``` 6. If you don't see a message indicating that `git {% data variables.large_files.command_name %} install` was successful, please contact {% data variables.contact.contact_support %}. Be sure to include the name of your operating system. {% endwindows %} @@ -84,29 +84,29 @@ shortTitle: Install Git LFS 2. On your computer, locate and unzip the downloaded file. {% data reusables.command_line.open_the_multi_os_terminal %} 3. Change the current working directory into the folder you downloaded and unzipped. - ```shell - $ cd ~/Downloads/git-lfs-1.X.X - ``` - {% note %} + ```shell + $ cd ~/Downloads/git-lfs-1.X.X + ``` + {% note %} - **Note:** The file path you use after `cd` depends on your operating system, Git LFS version you downloaded, and where you saved the {% data variables.large_files.product_name_short %} download. + **Note:** The file path you use after `cd` depends on your operating system, Git LFS version you downloaded, and where you saved the {% data variables.large_files.product_name_short %} download. - {% endnote %} + {% endnote %} 4. To install the file, run this command: - ```shell - $ ./install.sh - > {% data variables.large_files.product_name_short %} initialized. - ``` - {% note %} + ```shell + $ ./install.sh + > {% data variables.large_files.product_name_short %} initialized. + ``` + {% note %} - **Note:** You may have to use `sudo ./install.sh` to install the file. + **Note:** You may have to use `sudo ./install.sh` to install the file. - {% endnote %} + {% endnote %} 5. Verify that the installation was successful: - ```shell - $ git {% data variables.large_files.command_name %} install - > {% data variables.large_files.product_name_short %} initialized. - ``` + ```shell + $ git {% data variables.large_files.command_name %} install + > {% data variables.large_files.product_name_short %} initialized. + ``` 6. If you don't see a message indicating that `git {% data variables.large_files.command_name %} install` was successful, please contact {% data variables.contact.contact_support %}. Be sure to include the name of your operating system. {% endlinux %} diff --git a/content/repositories/working-with-files/managing-large-files/removing-files-from-git-large-file-storage.md b/content/repositories/working-with-files/managing-large-files/removing-files-from-git-large-file-storage.md index 55faeb3c4433..239269c189f2 100644 --- a/content/repositories/working-with-files/managing-large-files/removing-files-from-git-large-file-storage.md +++ b/content/repositories/working-with-files/managing-large-files/removing-files-from-git-large-file-storage.md @@ -29,13 +29,13 @@ shortTitle: Remove files 1. Remove the files from the repository's Git history using either the `filter-repo` command or BFG Repo-Cleaner. For detailed information on using these, see "[AUTOTITLE](/authentication/keeping-your-account-and-data-secure/removing-sensitive-data-from-a-repository)." 2. Optionally, to uninstall {% data variables.large_files.product_name_short %} in the repository, run: - ```shell - $ git lfs uninstall - ``` - For {% data variables.large_files.product_name_short %} versions below 1.1.0, run: - ```shell - $ git lfs uninit - ``` + ```shell + $ git lfs uninstall + ``` + For {% data variables.large_files.product_name_short %} versions below 1.1.0, run: + ```shell + $ git lfs uninit + ``` ## {% data variables.large_files.product_name_short %} objects in your repository diff --git a/content/repositories/working-with-files/managing-large-files/resolving-git-large-file-storage-upload-failures.md b/content/repositories/working-with-files/managing-large-files/resolving-git-large-file-storage-upload-failures.md index 6f989935f97c..997278ae578f 100644 --- a/content/repositories/working-with-files/managing-large-files/resolving-git-large-file-storage-upload-failures.md +++ b/content/repositories/working-with-files/managing-large-files/resolving-git-large-file-storage-upload-failures.md @@ -18,10 +18,10 @@ To resolve the error message, you must reinstall your local {% data variables.la 1. Open Terminal. 2. Reinstall {% data variables.large_files.product_name_short %}. - ```shell - $ git lfs install - ``` + ```shell + $ git lfs install + ``` 3. Push all referenced {% data variables.large_files.product_name_short %} files. - ```shell - $ git lfs push --all origin - ``` + ```shell + $ git lfs push --all origin + ``` diff --git a/content/support/contacting-github-support/providing-data-to-github-support.md b/content/support/contacting-github-support/providing-data-to-github-support.md index c4b29266b2ca..39fb71c8a19b 100644 --- a/content/support/contacting-github-support/providing-data-to-github-support.md +++ b/content/support/contacting-github-support/providing-data-to-github-support.md @@ -123,10 +123,10 @@ You can use these steps to create and share a support bundle if you have SSH acc {% data reusables.enterprise_enterprise_support.use_ghe_cluster_support_bundle %} 1. Download the support bundle via SSH: - ```shell - $ ssh -p 122 admin@HOSTNAME -- 'ghe-support-bundle -o' > support-bundle.tgz - ``` - For more information about the `ghe-support-bundle` command, see "[AUTOTITLE](/admin/configuration/configuring-your-enterprise/command-line-utilities#ghe-support-bundle)". + ```shell + $ ssh -p 122 admin@HOSTNAME -- 'ghe-support-bundle -o' > support-bundle.tgz + ``` + For more information about the `ghe-support-bundle` command, see "[AUTOTITLE](/admin/configuration/configuring-your-enterprise/command-line-utilities#ghe-support-bundle)". {% data reusables.enterprise_enterprise_support.sign-in-to-support %} {% data reusables.enterprise_enterprise_support.upload-support-bundle %} @@ -149,9 +149,9 @@ You can directly upload a support bundle to our server if: - Outbound HTTPS connections over TCP port 443 are allowed from {% data variables.location.product_location %} to _enterprise-bundles.github.com_ and _esbtoolsproduction.blob.core.windows.net_. 1. Upload the bundle to our support bundle server: - ```shell - $ ssh -p122 admin@HOSTNAME -- 'ghe-support-bundle -u' - ``` + ```shell + $ ssh -p122 admin@HOSTNAME -- 'ghe-support-bundle -u' + ``` ## Creating and sharing extended support bundles @@ -164,9 +164,9 @@ To prevent bundles from becoming too large, bundles only contain logs that haven You can use these steps to create and share an extended support bundle if you have SSH access to {% data variables.location.product_location %} and you have outbound internet access. 1. Download the extended support bundle via SSH by adding the `-x` flag to the `ghe-support-bundle` command: - ```shell - $ ssh -p 122 admin@HOSTNAME -- 'ghe-support-bundle -o -x' > support-bundle.tgz - ``` + ```shell + $ ssh -p 122 admin@HOSTNAME -- 'ghe-support-bundle -o -x' > support-bundle.tgz + ``` {% data reusables.enterprise_enterprise_support.sign-in-to-support %} {% data reusables.enterprise_enterprise_support.upload-support-bundle %} @@ -177,9 +177,9 @@ You can directly upload a support bundle to our server if: - Outbound HTTPS connections over TCP port 443 are allowed from {% data variables.location.product_location %} to _enterprise-bundles.github.com_ and _esbtoolsproduction.blob.core.windows.net_. 1. Upload the bundle to our support bundle server: - ```shell - $ ssh -p122 admin@HOSTNAME -- 'ghe-support-bundle -u -x' - ``` + ```shell + $ ssh -p122 admin@HOSTNAME -- 'ghe-support-bundle -u -x' + ``` ## Further reading