зеркало из https://github.com/github/docs.git
Consolidate product name variables for base URL (#50519)
This commit is contained in:
Родитель
ffa3daf310
Коммит
52b841ba12
|
@ -130,7 +130,7 @@ Email notifications from {% data variables.product.prodname_dotcom %} contain he
|
|||
| `From` address | This address will always be {% ifversion fpt or ghec %}'`notifications@github.com`'{% else %}'the no-reply email address configured by your site administrator'{% endif %}. |
|
||||
| `To` field | This field connects directly to the thread. If you reply to the email, you'll add a new comment to the conversation. |
|
||||
| `Cc` address | {% data variables.product.product_name %} will `Cc` you if you're subscribed to a conversation. The second `Cc` email address matches the notification reason. The suffix for these notification reasons is {% ifversion fpt or ghec %}`@noreply.github.com`{% else %}based on the no-reply email address configured by your site administrator{% endif %}. The possible notification reasons are: <ul><li>`assign`: You were assigned to an issue or pull request.</li><li>`author`: You created an issue or pull request.</li><li>`ci_activity`: A {% data variables.product.prodname_actions %} workflow run that you triggered was completed.</li><li>`comment`: You commented on an issue or pull request.</li><li>`manual`: There was an update to an issue or pull request you manually subscribed to.</li><li>`mention`: You were mentioned on an issue or pull request.</li><li>`push`: Someone committed to a pull request you're subscribed to.</li><li>`review_requested`: You or a team you're a member of was requested to review a pull request.</li><li>`security_alert`: {% data variables.product.prodname_dotcom %} detected a vulnerability in a repository you receive alerts for.</li><li>`state_change`: An issue or pull request you're subscribed to was either closed or opened.</li><li>`subscribed`: There was an update in a repository you're watching.</li><li>`team_mention`: A team you belong to was mentioned on an issue or pull request.</li><li>`your_activity`: You opened, commented on, or closed an issue or pull request.</li></ul> |
|
||||
| `List-Id` field | This field identifies the name of the repository and its owner. The format of this address is always `OWNER/REPOSITORY <REPOSITORY.OWNER>`, e.g. `List-Id: grain-lang/grain <grain.grain-lang.{% data variables.command_line.backticks %}>`. |
|
||||
| `List-Id` field | This field identifies the name of the repository and its owner. The format of this address is always `OWNER/REPOSITORY <REPOSITORY.OWNER>`, e.g. `List-Id: grain-lang/grain <grain.grain-lang.{% data variables.product.product_url %}>`. |
|
||||
| `X-GitHub-Severity` field | {% data reusables.repositories.security-alerts-x-github-severity %} The possible severity levels are:<ul><li>`low`</li><li>`moderate`</li><li>`high`</li><li>`critical`</li></ul>For more information, see "[AUTOTITLE](/code-security/dependabot/dependabot-alerts/about-dependabot-alerts)." |
|
||||
|
||||
## Choosing your notification settings
|
||||
|
|
|
@ -63,11 +63,11 @@ If you have any local copies of personal repositories you have created or forked
|
|||
$ cd YOUR-REPOSITORY
|
||||
# Change directories to the initialized Git repository
|
||||
$ git remote -v
|
||||
origin https://{% data variables.command_line.codeblock %}/YOUR-USERNAME/YOUR-REPOSITORY.git (fetch)
|
||||
origin https://{% data variables.command_line.codeblock %}/YOUR-USERNAME/YOUR-REPOSITORY.git (push)
|
||||
origin https://{% data variables.product.product_url %}/YOUR-USERNAME/YOUR-REPOSITORY.git (fetch)
|
||||
origin https://{% data variables.product.product_url %}/YOUR-USERNAME/YOUR-REPOSITORY.git (push)
|
||||
```
|
||||
|
||||
Your user name is what immediately follows the `https://{% data variables.command_line.backticks %}/`.
|
||||
Your user name is what immediately follows the `https://{% data variables.product.product_url %}/`.
|
||||
|
||||
{% ifversion fpt or ghec %}
|
||||
|
||||
|
|
|
@ -76,7 +76,7 @@ If the new owner of your old username creates a repository with the same name as
|
|||
|
||||
## Links to your previous profile page
|
||||
|
||||
After changing your username, links to your previous profile page, such as `https://{% data variables.command_line.backticks %}/previoususername`, will return a 404 error. We recommend updating any links to your account on {% data variables.location.product_location %} from elsewhere{% ifversion fpt or ghec %}, such as your LinkedIn or Twitter profile{% endif %}.
|
||||
After changing your username, links to your previous profile page, such as `https://{% data variables.product.product_url %}/previoususername`, will return a 404 error. We recommend updating any links to your account on {% data variables.location.product_location %} from elsewhere{% ifversion fpt or ghec %}, such as your LinkedIn or Twitter profile{% endif %}.
|
||||
|
||||
## Your Git commits
|
||||
|
||||
|
|
|
@ -25,14 +25,14 @@ You'll need to authenticate this action using your password, which is the SSH ke
|
|||
1. Enter the following:
|
||||
|
||||
```shell replacedomain copy
|
||||
ssh -T git@{% data variables.command_line.codeblock %}
|
||||
ssh -T git@{% data variables.product.product_url %}
|
||||
# Attempts to ssh to {% data variables.product.product_name %}
|
||||
```
|
||||
|
||||
You may see a warning like this:
|
||||
|
||||
```shell replacedomain
|
||||
> The authenticity of host '{% data variables.command_line.codeblock %} (IP ADDRESS)' can't be established.
|
||||
> The authenticity of host '{% data variables.product.product_url %} (IP ADDRESS)' can't be established.
|
||||
> ED25519 key fingerprint is SHA256:+DiY3wvvV6TuJJhbpZisF/zLDA0zPMSvHdkr4UvCOqU.
|
||||
> Are you sure you want to continue connecting (yes/no)?
|
||||
```
|
||||
|
|
|
@ -166,7 +166,7 @@ Once you have a {% data variables.product.pat_generic %}, you can enter it inste
|
|||
For example, to clone a repository on the command line you would enter the following `git clone` command. You would then be prompted to enter your username and password. When prompted for your password, enter your {% data variables.product.pat_generic %} instead of a password.
|
||||
|
||||
```shell
|
||||
$ git clone https://{% data variables.command_line.codeblock %}/USERNAME/REPO.git
|
||||
$ git clone https://{% data variables.product.product_url %}/USERNAME/REPO.git
|
||||
Username: YOUR-USERNAME
|
||||
Password: YOUR-PERSONAL-ACCESS-TOKEN
|
||||
```
|
||||
|
|
|
@ -95,7 +95,7 @@ To illustrate how `git filter-repo` works, we'll show you how to remove your fil
|
|||
1. 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
|
||||
$ git clone https://{% data variables.product.product_url %}/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.
|
||||
|
@ -159,7 +159,7 @@ To illustrate how `git filter-repo` works, we'll show you how to remove your fil
|
|||
> 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
|
||||
> To https://{% data variables.product.product_url %}/YOUR-USERNAME/YOUR-REPOSITORY.git
|
||||
> + 48dc599...051452f main -> main (forced update)
|
||||
```
|
||||
|
||||
|
@ -172,7 +172,7 @@ To illustrate how `git filter-repo` works, we'll show you how to remove your fil
|
|||
> 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
|
||||
> To https://{% data variables.product.product_url %}/YOUR-USERNAME/YOUR-REPOSITORY.git
|
||||
> + 48dc599...051452f main -> main (forced update)
|
||||
```
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ shortTitle: Agent failure to sign
|
|||
When trying to SSH into {% data variables.location.product_location %} on a Linux computer, you may see the following message in your terminal:
|
||||
|
||||
```shell
|
||||
$ ssh -vT git@{% data variables.command_line.codeblock %}
|
||||
$ ssh -vT git@{% data variables.product.product_url %}
|
||||
> ...
|
||||
> Agent admitted failure to sign using the key.
|
||||
> debug1: No more authentication methods to try.
|
||||
|
|
|
@ -15,12 +15,12 @@ topics:
|
|||
When running remote Git commands or SSH, your connection might time out:
|
||||
|
||||
```shell
|
||||
$ ssh -vT git@{% data variables.command_line.codeblock %}
|
||||
$ ssh -vT git@{% data variables.product.product_url %}
|
||||
> OpenSSH_8.1p1, LibreSSL 2.7.3
|
||||
> debug1: Connecting to {% data variables.command_line.codeblock %} [207.97.227.239] port 22.
|
||||
> debug1: Connecting to {% data variables.product.product_url %} [207.97.227.239] port 22.
|
||||
> debug1: connect to address 207.97.227.239 port 22: Connection timed out
|
||||
> ssh: connect to host {% data variables.command_line.codeblock %} port 22: Connection timed out
|
||||
> ssh: connect to host {% data variables.command_line.codeblock %} port 22: Bad file number
|
||||
> ssh: connect to host {% data variables.product.product_url %} port 22: Connection timed out
|
||||
> ssh: connect to host {% data variables.product.product_url %} port 22: Bad file number
|
||||
```
|
||||
|
||||
## Solving the issue
|
||||
|
@ -30,7 +30,7 @@ $ ssh -vT git@{% data variables.command_line.codeblock %}
|
|||
Often, the simplest solution is to simply avoid SSH entirely. Most firewalls and proxies allow HTTPS traffic without issue. To take advantage of this, change [the remote URL](/get-started/getting-started-with-git/about-remote-repositories) you're using:
|
||||
|
||||
```shell
|
||||
$ git clone https://{% data variables.command_line.codeblock %}/USERNAME/REPO-NAME.git
|
||||
$ git clone https://{% data variables.product.product_url %}/USERNAME/REPO-NAME.git
|
||||
> Cloning into 'reponame'...
|
||||
> remote: Counting objects: 84, done.
|
||||
> remote: Compressing objects: 100% (45/45), done.
|
||||
|
|
|
@ -17,7 +17,7 @@ topics:
|
|||
To determine where the key has already been used, open a terminal and type the `ssh` command. Use the `-i` flag to provide the path to the key you want to check:
|
||||
|
||||
```shell
|
||||
$ ssh -T -ai ~/.ssh/id_rsa git@{% data variables.command_line.codeblock %}
|
||||
$ ssh -T -ai ~/.ssh/id_rsa git@{% data variables.product.product_url %}
|
||||
# Connect to {% data variables.location.product_location %} using a specific ssh key
|
||||
> Hi USERNAME! You've successfully authenticated, but GitHub does not
|
||||
> provide shell access.
|
||||
|
@ -28,7 +28,7 @@ The _username_ in the response is the account on {% data variables.location.prod
|
|||
To force SSH to use only the key provided on the command line, use `-o` to add the `IdentitiesOnly=yes` option:
|
||||
|
||||
```shell
|
||||
ssh -v -o "IdentitiesOnly=yes" -i ~/.ssh/id_rsa git@{% data variables.command_line.codeblock %}
|
||||
ssh -v -o "IdentitiesOnly=yes" -i ~/.ssh/id_rsa git@{% data variables.product.product_url %}
|
||||
```
|
||||
|
||||
## Fixing the issue
|
||||
|
|
|
@ -25,7 +25,7 @@ If you have a _very good reason_ you must use `sudo`, then ensure you are using
|
|||
To make sure you are connecting to the right domain, you can enter the following command:
|
||||
|
||||
```shell replacedomain copy
|
||||
ssh -vT git@{% data variables.command_line.codeblock %}
|
||||
ssh -vT git@{% data variables.product.product_url %}
|
||||
```
|
||||
|
||||
You should see this output:
|
||||
|
@ -35,7 +35,7 @@ You should see this output:
|
|||
> debug1: Reading configuration data /Users/YOU/.ssh/config
|
||||
> debug1: Reading configuration data /etc/ssh/ssh_config
|
||||
> debug1: /etc/ssh/ssh_config line 47: Applying options for *
|
||||
> debug1: Connecting to {% data variables.command_line.codeblock %} port 22.
|
||||
> debug1: Connecting to {% data variables.product.product_url %} port 22.
|
||||
```
|
||||
|
||||
The connection should be made on port 22{% ifversion fpt or ghec %}, unless you're overriding settings to use [SSH over HTTPS](/authentication/troubleshooting-ssh/using-ssh-over-the-https-port){% endif %}.
|
||||
|
@ -45,7 +45,7 @@ The connection should be made on port 22{% ifversion fpt or ghec %}, unless you'
|
|||
All connections, including those for remote URLs, must be made as the "git" user. If you try to connect with your {% data variables.product.product_name %} username, it will fail:
|
||||
|
||||
```shell replacedomain
|
||||
$ ssh -T GITHUB-USERNAME@{% data variables.command_line.codeblock %}
|
||||
$ ssh -T GITHUB-USERNAME@{% data variables.product.product_url %}
|
||||
> Permission denied (publickey).
|
||||
```
|
||||
|
||||
|
@ -54,7 +54,7 @@ If your connection failed and you're using a remote URL with your {% data variab
|
|||
You should verify your connection by typing:
|
||||
|
||||
```shell replacedomain copy
|
||||
ssh -T git@{% data variables.command_line.codeblock %}
|
||||
ssh -T git@{% data variables.product.product_url %}
|
||||
```
|
||||
|
||||
You should see this output:
|
||||
|
@ -122,10 +122,10 @@ The `ssh-add` command _should_ print out a long string of numbers and letters. I
|
|||
|
||||
### Getting more details
|
||||
|
||||
You can also check that the key is being used by trying to connect to `git@{% data variables.command_line.backticks %}`:
|
||||
You can also check that the key is being used by trying to connect to `git@{% data variables.product.product_url %}`:
|
||||
|
||||
```shell replacedomain copy
|
||||
ssh -vT git@{% data variables.command_line.codeblock %}
|
||||
ssh -vT git@{% data variables.product.product_url %}
|
||||
```
|
||||
|
||||
You'll see output like this:
|
||||
|
|
|
@ -28,7 +28,7 @@ $ ssh -T -p 443 git@ssh.github.com
|
|||
|
||||
{% note %}
|
||||
|
||||
**Note**: The hostname for port 443 is `ssh.{% data variables.command_line.backticks %}`, not `{% data variables.command_line.backticks %}`.
|
||||
**Note**: The hostname for port 443 is `ssh.{% data variables.product.product_url %}`, not `{% data variables.product.product_url %}`.
|
||||
|
||||
{% endnote %}
|
||||
|
||||
|
@ -37,18 +37,18 @@ If that worked, great! If not, you may need to [follow our troubleshooting guide
|
|||
Now, to clone the repository, you can run the following command:
|
||||
|
||||
```shell
|
||||
git clone ssh://git@ssh.{% data variables.command_line.codeblock %}:443/YOUR-USERNAME/YOUR-REPOSITORY.git
|
||||
git clone ssh://git@ssh.{% data variables.product.product_url %}:443/YOUR-USERNAME/YOUR-REPOSITORY.git
|
||||
```
|
||||
|
||||
## Enabling SSH connections over HTTPS
|
||||
|
||||
If you are able to SSH into `git@ssh.{% data variables.command_line.backticks %}` over port 443, you can override your SSH settings to force any connection to {% data variables.location.product_location %} to run through that server and port.
|
||||
If you are able to SSH into `git@ssh.{% data variables.product.product_url %}` over port 443, you can override your SSH settings to force any connection to {% data variables.location.product_location %} to run through that server and port.
|
||||
|
||||
To set this in your SSH configuration file, edit the file at `~/.ssh/config`, and add this section:
|
||||
|
||||
```text
|
||||
Host {% data variables.command_line.codeblock %}
|
||||
Hostname ssh.{% data variables.command_line.codeblock %}
|
||||
Host {% data variables.product.product_url %}
|
||||
Hostname ssh.{% data variables.product.product_url %}
|
||||
Port 443
|
||||
User git
|
||||
```
|
||||
|
@ -56,7 +56,7 @@ Host {% data variables.command_line.codeblock %}
|
|||
You can test that this works by connecting once more to {% data variables.location.product_location %}:
|
||||
|
||||
```shell
|
||||
$ ssh -T git@{% data variables.command_line.codeblock %}
|
||||
$ ssh -T git@{% data variables.product.product_url %}
|
||||
> Hi USERNAME! You've successfully authenticated, but GitHub does not
|
||||
> provide shell access.
|
||||
```
|
||||
|
|
|
@ -62,13 +62,13 @@ You can clone your fork with the command line, {% data variables.product.prodnam
|
|||
1. 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
|
||||
git clone https://{% data variables.product.product_url %}/YOUR-USERNAME/Spoon-Knife
|
||||
```
|
||||
|
||||
1. Press **Enter**. Your local clone will be created.
|
||||
|
||||
```shell
|
||||
$ git clone https://{% data variables.command_line.codeblock %}/YOUR-USERNAME/Spoon-Knife
|
||||
$ git clone https://{% data variables.product.product_url %}/YOUR-USERNAME/Spoon-Knife
|
||||
> Cloning into `Spoon-Knife`...
|
||||
> remote: Counting objects: 10, done.
|
||||
> remote: Compressing objects: 100% (8/8), done.
|
||||
|
|
|
@ -22,8 +22,8 @@ A remote URL is Git's fancy way of saying "the place where your code is stored."
|
|||
|
||||
You can only push to two types of URL addresses:
|
||||
|
||||
- An HTTPS URL like `https://{% data variables.command_line.backticks %}/user/repo.git`
|
||||
- An SSH URL, like `git@{% data variables.command_line.backticks %}:user/repo.git`
|
||||
- An HTTPS URL like `https://{% data variables.product.product_url %}/user/repo.git`
|
||||
- An SSH URL, like `git@{% data variables.product.product_url %}:user/repo.git`
|
||||
|
||||
Git associates a remote URL with a name, and your default remote is usually called `origin`.
|
||||
|
||||
|
|
|
@ -30,18 +30,18 @@ To add a new remote, use the `git remote add` command on the terminal, in the di
|
|||
|
||||
The `git remote add` command takes two arguments:
|
||||
- A remote name, for example, `origin`
|
||||
- A remote URL, for example, `https://{% data variables.command_line.backticks %}/OWNER/REPOSITORY.git`
|
||||
- A remote URL, for example, `https://{% data variables.product.product_url %}/OWNER/REPOSITORY.git`
|
||||
|
||||
For example:
|
||||
|
||||
```shell
|
||||
$ git remote add origin https://{% data variables.command_line.codeblock %}/OWNER/REPOSITORY.git
|
||||
$ git remote add origin https://{% data variables.product.product_url %}/OWNER/REPOSITORY.git
|
||||
# Set a new remote
|
||||
|
||||
$ git remote -v
|
||||
# Verify new remote
|
||||
> origin https://{% data variables.command_line.codeblock %}/OWNER/REPOSITORY.git (fetch)
|
||||
> origin https://{% data variables.command_line.codeblock %}/OWNER/REPOSITORY.git (push)
|
||||
> origin https://{% data variables.product.product_url %}/OWNER/REPOSITORY.git (fetch)
|
||||
> origin https://{% data variables.product.product_url %}/OWNER/REPOSITORY.git (push)
|
||||
```
|
||||
|
||||
For more information on which URL to use, see "[AUTOTITLE](/get-started/getting-started-with-git/about-remote-repositories)."
|
||||
|
@ -51,7 +51,7 @@ For more information on which URL to use, see "[AUTOTITLE](/get-started/getting-
|
|||
This error means you've tried to add a remote with a name that already exists in your local repository.
|
||||
|
||||
```shell
|
||||
$ git remote add origin https://{% data variables.command_line.codeblock %}/octocat/Spoon-Knife.git
|
||||
$ git remote add origin https://{% data variables.product.product_url %}/octocat/Spoon-Knife.git
|
||||
> fatal: remote origin already exists.
|
||||
```
|
||||
|
||||
|
@ -77,13 +77,13 @@ The `git remote set-url` command takes two arguments:
|
|||
- If you're updating to use HTTPS, your URL might look like:
|
||||
|
||||
```shell
|
||||
https://{% data variables.command_line.backticks %}/OWNER/REPOSITORY.git
|
||||
https://{% data variables.product.product_url %}/OWNER/REPOSITORY.git
|
||||
```
|
||||
|
||||
- If you're updating to use SSH, your URL might look like:
|
||||
|
||||
```shell
|
||||
git@{% data variables.command_line.codeblock %}:OWNER/REPOSITORY.git
|
||||
git@{% data variables.product.product_url %}:OWNER/REPOSITORY.git
|
||||
```
|
||||
|
||||
### Switching remote URLs from SSH to HTTPS
|
||||
|
@ -94,14 +94,14 @@ The `git remote set-url` command takes two arguments:
|
|||
|
||||
```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)
|
||||
> origin git@{% data variables.product.product_url %}:OWNER/REPOSITORY.git (fetch)
|
||||
> origin git@{% data variables.product.product_url %}:OWNER/REPOSITORY.git (push)
|
||||
```
|
||||
|
||||
1. 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
|
||||
git remote set-url origin https://{% data variables.product.product_url %}/OWNER/REPOSITORY.git
|
||||
```
|
||||
|
||||
1. Verify that the remote URL has changed.
|
||||
|
@ -109,8 +109,8 @@ The `git remote set-url` command takes two arguments:
|
|||
```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)
|
||||
> origin https://{% data variables.product.product_url %}/OWNER/REPOSITORY.git (fetch)
|
||||
> origin https://{% data variables.product.product_url %}/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 %}
|
||||
|
@ -125,14 +125,14 @@ You can [use a credential helper](/get-started/getting-started-with-git/caching-
|
|||
|
||||
```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)
|
||||
> origin https://{% data variables.product.product_url %}/OWNER/REPOSITORY.git (fetch)
|
||||
> origin https://{% data variables.product.product_url %}/OWNER/REPOSITORY.git (push)
|
||||
```
|
||||
|
||||
1. 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
|
||||
git remote set-url origin git@{% data variables.product.product_url %}:OWNER/REPOSITORY.git
|
||||
```
|
||||
|
||||
1. Verify that the remote URL has changed.
|
||||
|
@ -140,8 +140,8 @@ You can [use a credential helper](/get-started/getting-started-with-git/caching-
|
|||
```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)
|
||||
> origin git@{% data variables.product.product_url %}:OWNER/REPOSITORY.git (fetch)
|
||||
> origin git@{% data variables.product.product_url %}:OWNER/REPOSITORY.git (push)
|
||||
```
|
||||
|
||||
### Troubleshooting: No such remote '[name]'
|
||||
|
@ -149,7 +149,7 @@ You can [use a credential helper](/get-started/getting-started-with-git/caching-
|
|||
This error means that the remote you tried to change doesn't exist:
|
||||
|
||||
```shell
|
||||
$ git remote set-url sofake https://{% data variables.command_line.codeblock %}/octocat/Spoon-Knife
|
||||
$ git remote set-url sofake https://{% data variables.product.product_url %}/octocat/Spoon-Knife
|
||||
> fatal: No such remote 'sofake'
|
||||
```
|
||||
|
||||
|
@ -170,16 +170,16 @@ These examples assume you're [cloning using HTTPS](/get-started/getting-started-
|
|||
```shell
|
||||
$ git remote -v
|
||||
# View existing remotes
|
||||
> origin https://{% data variables.command_line.codeblock %}/OWNER/REPOSITORY.git (fetch)
|
||||
> origin https://{% data variables.command_line.codeblock %}/OWNER/REPOSITORY.git (push)
|
||||
> origin https://{% data variables.product.product_url %}/OWNER/REPOSITORY.git (fetch)
|
||||
> origin https://{% data variables.product.product_url %}/OWNER/REPOSITORY.git (push)
|
||||
|
||||
$ git remote rename origin destination
|
||||
# Change remote name from 'origin' to 'destination'
|
||||
|
||||
$ git remote -v
|
||||
# Verify remote's new name
|
||||
> destination https://{% data variables.command_line.codeblock %}/OWNER/REPOSITORY.git (fetch)
|
||||
> destination https://{% data variables.command_line.codeblock %}/OWNER/REPOSITORY.git (push)
|
||||
> destination https://{% data variables.product.product_url %}/OWNER/REPOSITORY.git (fetch)
|
||||
> destination https://{% data variables.product.product_url %}/OWNER/REPOSITORY.git (push)
|
||||
```
|
||||
|
||||
### Troubleshooting: Could not rename config section 'remote.[old name]' to 'remote.[new name]'
|
||||
|
@ -191,8 +191,8 @@ You can check which remotes currently exist with the `git remote -v` command:
|
|||
```shell
|
||||
$ git remote -v
|
||||
# View existing remotes
|
||||
> origin https://{% data variables.command_line.codeblock %}/OWNER/REPOSITORY.git (fetch)
|
||||
> origin https://{% data variables.command_line.codeblock %}/OWNER/REPOSITORY.git (push)
|
||||
> origin https://{% data variables.product.product_url %}/OWNER/REPOSITORY.git (fetch)
|
||||
> origin https://{% data variables.product.product_url %}/OWNER/REPOSITORY.git (push)
|
||||
```
|
||||
|
||||
### Troubleshooting: Remote [new name] already exists
|
||||
|
@ -215,17 +215,17 @@ These examples assume you're [cloning using HTTPS](/get-started/getting-started-
|
|||
```shell
|
||||
$ git remote -v
|
||||
# View current remotes
|
||||
> origin https://{% data variables.command_line.codeblock %}/OWNER/REPOSITORY.git (fetch)
|
||||
> origin https://{% data variables.command_line.codeblock %}/OWNER/REPOSITORY.git (push)
|
||||
> destination https://{% data variables.command_line.codeblock %}/FORKER/REPOSITORY.git (fetch)
|
||||
> destination https://{% data variables.command_line.codeblock %}/FORKER/REPOSITORY.git (push)
|
||||
> origin https://{% data variables.product.product_url %}/OWNER/REPOSITORY.git (fetch)
|
||||
> origin https://{% data variables.product.product_url %}/OWNER/REPOSITORY.git (push)
|
||||
> destination https://{% data variables.product.product_url %}/FORKER/REPOSITORY.git (fetch)
|
||||
> destination https://{% data variables.product.product_url %}/FORKER/REPOSITORY.git (push)
|
||||
|
||||
$ git remote rm destination
|
||||
# Remove remote
|
||||
$ git remote -v
|
||||
# Verify it's gone
|
||||
> origin https://{% data variables.command_line.codeblock %}/OWNER/REPOSITORY.git (fetch)
|
||||
> origin https://{% data variables.command_line.codeblock %}/OWNER/REPOSITORY.git (push)
|
||||
> origin https://{% data variables.product.product_url %}/OWNER/REPOSITORY.git (fetch)
|
||||
> origin https://{% data variables.product.product_url %}/OWNER/REPOSITORY.git (push)
|
||||
```
|
||||
|
||||
{% warning %}
|
||||
|
|
|
@ -27,8 +27,8 @@ We recommend you either [configure SSH](/authentication/connecting-to-github-wit
|
|||
|
||||
1. Click on the Spotlight icon (magnifying glass) on the right side of the menu bar.
|
||||
1. Type `Keychain Access`, then press the Enter key to launch the app.
|
||||
1. In Keychain Access, search for `{% data variables.command_line.backticks %}`.
|
||||
1. Find the "Internet password" entry for `{% data variables.command_line.backticks %}`.
|
||||
1. In Keychain Access, search for `{% data variables.product.product_url %}`.
|
||||
1. Find the "Internet password" entry for `{% data variables.product.product_url %}`.
|
||||
1. Edit or delete the entry accordingly.
|
||||
|
||||
## Deleting your credentials via the command line
|
||||
|
@ -37,7 +37,7 @@ Through the command line, you can use the credential helper directly to erase th
|
|||
|
||||
```shell
|
||||
$ git credential-osxkeychain erase
|
||||
host={% data variables.command_line.codeblock %}
|
||||
host={% data variables.product.product_url %}
|
||||
protocol=https
|
||||
> [Press Return]
|
||||
```
|
||||
|
|
|
@ -16,9 +16,9 @@ If another person has pushed to the same branch as you, Git won't be able to pus
|
|||
|
||||
```shell
|
||||
$ git push origin main
|
||||
> To https://{% data variables.command_line.codeblock %}/USERNAME/REPOSITORY.git
|
||||
> To https://{% data variables.product.product_url %}/USERNAME/REPOSITORY.git
|
||||
> ! [rejected] main -> main (non-fast-forward)
|
||||
> error: failed to push some refs to 'https://{% data variables.command_line.codeblock %}/USERNAME/REPOSITORY.git'
|
||||
> error: failed to push some refs to 'https://{% data variables.product.product_url %}/USERNAME/REPOSITORY.git'
|
||||
> To prevent you from losing history, non-fast-forward updates were rejected
|
||||
> Merge the remote changes (e.g. 'git pull') before pushing again. See the
|
||||
> 'Note about fast-forwards' section of 'git push --help' for details.
|
||||
|
|
|
@ -22,7 +22,7 @@ These commands are very useful when interacting with [a remote repository](/get-
|
|||
To grab a complete copy of another user's repository, use `git clone` like this:
|
||||
|
||||
```shell
|
||||
$ git clone https://{% data variables.command_line.codeblock %}/USERNAME/REPOSITORY.git
|
||||
$ git clone https://{% data variables.product.product_url %}/USERNAME/REPOSITORY.git
|
||||
# Clones a repository to your computer
|
||||
```
|
||||
|
||||
|
|
|
@ -101,7 +101,7 @@ git fetch upstream
|
|||
> remote: Compressing objects: 100% (53/53), done.
|
||||
> remote: Total 62 (delta 27), reused 44 (delta 9)
|
||||
> Unpacking objects: 100% (62/62), done.
|
||||
> From https://{% data variables.command_line.codeblock %}/OCTOCAT/REPO
|
||||
> From https://{% data variables.product.product_url %}/OCTOCAT/REPO
|
||||
> * [new branch] main -> upstream/main
|
||||
```
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ If you create a new clone of the repository, you won't lose any of your Git hist
|
|||
1. Clone the repository that contains the subfolder.
|
||||
|
||||
```shell
|
||||
git clone https://{% data variables.command_line.codeblock %}/USERNAME/REPOSITORY-NAME
|
||||
git clone https://{% data variables.product.product_url %}/USERNAME/REPOSITORY-NAME
|
||||
```
|
||||
|
||||
1. Change the current working directory to your cloned repository.
|
||||
|
@ -80,7 +80,7 @@ If you create a new clone of the repository, you won't lose any of your Git hist
|
|||
1. Add a new remote name with the URL you copied for your repository. For example, `origin` or `upstream` are two common choices.
|
||||
|
||||
```shell
|
||||
git remote add origin https://{% data variables.command_line.codeblock %}/USERNAME/REPOSITORY-NAME.git
|
||||
git remote add origin https://{% data variables.product.product_url %}/USERNAME/REPOSITORY-NAME.git
|
||||
```
|
||||
|
||||
1. Verify that the remote URL was added with your new repository name.
|
||||
|
@ -88,8 +88,8 @@ If you create a new clone of the repository, you won't lose any of your Git hist
|
|||
```shell
|
||||
$ git remote -v
|
||||
# Verify new remote URL
|
||||
> origin https://{% data variables.command_line.codeblock %}/USERNAME/NEW-REPOSITORY-NAME.git (fetch)
|
||||
> origin https://{% data variables.command_line.codeblock %}/USERNAME/NEW-REPOSITORY-NAME.git (push)
|
||||
> origin https://{% data variables.product.product_url %}/USERNAME/NEW-REPOSITORY-NAME.git (fetch)
|
||||
> origin https://{% data variables.product.product_url %}/USERNAME/NEW-REPOSITORY-NAME.git (push)
|
||||
```
|
||||
|
||||
1. Push your changes to the new repository on {% data variables.product.product_name %}.
|
||||
|
|
|
@ -41,7 +41,7 @@ For purposes of demonstration, we'll use:
|
|||
|
||||
```shell
|
||||
$ cd REPO.git
|
||||
$ git push --mirror https://{% data variables.command_line.codeblock %}/USER/REPO.git
|
||||
$ git push --mirror https://{% data variables.product.product_url %}/USER/REPO.git
|
||||
# Pushes the mirror to the new repository on {% data variables.location.product_location %}
|
||||
```
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ After changing your organization's name, your old organization name becomes avai
|
|||
### Changes that aren't automatic
|
||||
|
||||
After changing your organization's name:
|
||||
- Links to your previous organization profile page, such as `https://{% data variables.command_line.backticks %}/previousorgname`, will return a 404 error. We recommend you update links to your organization from other sites{% ifversion fpt or ghec %}, such as your LinkedIn or Twitter profiles{% endif %}.
|
||||
- Links to your previous organization profile page, such as `https://{% data variables.product.product_url %}/previousorgname`, will return a 404 error. We recommend you update links to your organization from other sites{% ifversion fpt or ghec %}, such as your LinkedIn or Twitter profiles{% endif %}.
|
||||
- API requests that use the old organization's name will return a 404 error. We recommend you update the old organization name in your API requests.
|
||||
- There are no automatic [@mention](/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax#mentioning-people-and-teams) redirects for teams that use the old organization's name.{% ifversion ghec %}
|
||||
- If SAML single sign-on (SSO) and/or is enabled for the organization, you must update the organization name in the application for {% data variables.product.prodname_ghe_cloud %} on your identity provider (IdP). If you don't update the organization name on your IdP, members of the organization will no longer be able to authenticate with your IdP to access the organization's resources. For more information, see "[AUTOTITLE](/organizations/managing-saml-single-sign-on-for-your-organization/connecting-your-identity-provider-to-your-organization)."
|
||||
|
|
|
@ -45,13 +45,13 @@ Only the user who created the pull request can give you permission to push commi
|
|||
1. 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
|
||||
git clone https://{% data variables.product.product_url %}/USERNAME/FORK-OF-THE-REPOSITORY
|
||||
```
|
||||
|
||||
1. Press **Enter**. Your local clone will be created.
|
||||
|
||||
```shell
|
||||
$ git clone https://{% data variables.command_line.codeblock %}/USERNAME/FORK-OF-THE-REPOSITORY
|
||||
$ git clone https://{% data variables.product.product_url %}/USERNAME/FORK-OF-THE-REPOSITORY
|
||||
> Cloning into `FORK-OF-THE-REPOSITORY`...
|
||||
> remote: Counting objects: 10, done.
|
||||
> remote: Compressing objects: 100% (8/8), done.
|
||||
|
@ -93,7 +93,7 @@ Only the user who created the pull request can give you permission to push commi
|
|||
> 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
|
||||
> To https://{% data variables.product.product_url %}/USERNAME/FORK-OF-THE-REPOSITORY.git
|
||||
> 12da2e9..250e946 TEST-BRANCH -> TEST-BRANCH
|
||||
```
|
||||
|
||||
|
|
|
@ -91,7 +91,7 @@ Anyone can work with a previously opened pull request to continue working on it,
|
|||
> 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
|
||||
> To https://{% data variables.product.product_url %}/USERNAME/REPOSITORY.git
|
||||
> * [new branch] BRANCH_NAME -> BRANCH_NAME
|
||||
```
|
||||
|
||||
|
|
|
@ -20,22 +20,22 @@ shortTitle: Configure a remote repository
|
|||
|
||||
```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)
|
||||
> origin https://{% data variables.product.product_url %}/YOUR-USERNAME/YOUR-FORK.git (fetch)
|
||||
> origin https://{% data variables.product.product_url %}/YOUR-USERNAME/YOUR-FORK.git (push)
|
||||
```
|
||||
|
||||
1. 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
|
||||
git remote add upstream https://{% data variables.product.product_url %}/ORIGINAL-OWNER/ORIGINAL-REPOSITORY.git
|
||||
```
|
||||
|
||||
1. 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)
|
||||
> origin https://{% data variables.product.product_url %}/YOUR-USERNAME/YOUR-FORK.git (fetch)
|
||||
> origin https://{% data variables.product.product_url %}/YOUR-USERNAME/YOUR-FORK.git (push)
|
||||
> upstream https://{% data variables.product.product_url %}/ORIGINAL-OWNER/ORIGINAL-REPOSITORY.git (fetch)
|
||||
> upstream https://{% data variables.product.product_url %}/ORIGINAL-OWNER/ORIGINAL-REPOSITORY.git (push)
|
||||
```
|
||||
|
|
|
@ -43,7 +43,7 @@ You can delete a fork and recreate the same repository, without the connection t
|
|||
1. Create a bare clone of the fork.
|
||||
|
||||
```shell
|
||||
git clone --bare https://{% data variables.command_line.codeblock %}/EXAMPLE-USER/FORK-NAME.git
|
||||
git clone --bare https://{% data variables.product.product_url %}/EXAMPLE-USER/FORK-NAME.git
|
||||
```
|
||||
|
||||
1. Delete the forked repository. For more information, see "[AUTOTITLE](/repositories/creating-and-managing-repositories/deleting-a-repository)."<br><br>
|
||||
|
|
|
@ -109,13 +109,13 @@ Right now, you have a fork of the Spoon-Knife repository, but you do not have th
|
|||
1. 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
|
||||
git clone https://{% data variables.product.product_url %}/YOUR-USERNAME/Spoon-Knife
|
||||
```
|
||||
|
||||
1. Press **Enter**. Your local clone will be created.
|
||||
|
||||
```shell
|
||||
$ git clone https://{% data variables.command_line.codeblock %}/YOUR-USERNAME/Spoon-Knife
|
||||
$ git clone https://{% data variables.product.product_url %}/YOUR-USERNAME/Spoon-Knife
|
||||
> Cloning into `Spoon-Knife`...
|
||||
> remote: Counting objects: 10, done.
|
||||
> remote: Compressing objects: 100% (8/8), done.
|
||||
|
@ -165,24 +165,24 @@ When you fork a project in order to propose changes to the upstream repository,
|
|||
|
||||
```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)
|
||||
> origin https://{% data variables.product.product_url %}/YOUR-USERNAME/YOUR-FORK.git (fetch)
|
||||
> origin https://{% data variables.product.product_url %}/YOUR-USERNAME/YOUR-FORK.git (push)
|
||||
```
|
||||
|
||||
1. 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
|
||||
git remote add upstream https://{% data variables.product.product_url %}/ORIGINAL-OWNER/Spoon-Knife.git
|
||||
```
|
||||
|
||||
1. 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)
|
||||
> origin https://{% data variables.product.product_url %}/YOUR-USERNAME/YOUR-FORK.git (fetch)
|
||||
> origin https://{% data variables.product.product_url %}/YOUR-USERNAME/YOUR-FORK.git (push)
|
||||
> upstream https://{% data variables.product.product_url %}/ORIGINAL-OWNER/ORIGINAL-REPOSITORY.git (fetch)
|
||||
> upstream https://{% data variables.product.product_url %}/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)."
|
||||
|
|
|
@ -64,7 +64,7 @@ Before you can sync your fork with an upstream repository, you must configure a
|
|||
> remote: Compressing objects: 100% (53/53), done.
|
||||
> remote: Total 62 (delta 27), reused 44 (delta 9)
|
||||
> Unpacking objects: 100% (62/62), done.
|
||||
> From https://{% data variables.command_line.codeblock %}/ORIGINAL-OWNER/ORIGINAL-REPOSITORY
|
||||
> From https://{% data variables.product.product_url %}/ORIGINAL-OWNER/ORIGINAL-REPOSITORY
|
||||
> * [new branch] main -> upstream/main
|
||||
```
|
||||
|
||||
|
|
|
@ -31,14 +31,14 @@ Before you can push the original repository to your new copy, or _mirror_, of th
|
|||
1. Create a bare clone of the repository.
|
||||
|
||||
```shell
|
||||
git clone --bare https://{% data variables.command_line.codeblock %}/EXAMPLE-USER/OLD-REPOSITORY.git
|
||||
git clone --bare https://{% data variables.product.product_url %}/EXAMPLE-USER/OLD-REPOSITORY.git
|
||||
```
|
||||
|
||||
1. 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
|
||||
git push --mirror https://{% data variables.product.product_url %}/EXAMPLE-USER/NEW-REPOSITORY.git
|
||||
```
|
||||
|
||||
1. Remove the temporary local repository you created earlier.
|
||||
|
@ -54,7 +54,7 @@ Before you can push the original repository to your new copy, or _mirror_, of th
|
|||
1. 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
|
||||
git clone --bare https://{% data variables.product.product_url %}/EXAMPLE-USER/OLD-REPOSITORY.git
|
||||
```
|
||||
|
||||
1. Navigate to the repository you just cloned.
|
||||
|
@ -72,7 +72,7 @@ Before you can push the original repository to your new copy, or _mirror_, of th
|
|||
1. Mirror-push to the new repository.
|
||||
|
||||
```shell
|
||||
git push --mirror https://{% data variables.command_line.codeblock %}/EXAMPLE-USER/NEW-REPOSITORY.git
|
||||
git push --mirror https://{% data variables.product.product_url %}/EXAMPLE-USER/NEW-REPOSITORY.git
|
||||
```
|
||||
|
||||
1. Push the repository's {% data variables.large_files.product_name_long %} objects to your mirror.
|
||||
|
@ -96,14 +96,14 @@ If you want to mirror a repository in another location, including getting update
|
|||
1. Create a bare mirrored clone of the repository.
|
||||
|
||||
```shell
|
||||
git clone --mirror https://{% data variables.command_line.codeblock %}/EXAMPLE-USER/REPOSITORY-TO-MIRROR.git
|
||||
git clone --mirror https://{% data variables.product.product_url %}/EXAMPLE-USER/REPOSITORY-TO-MIRROR.git
|
||||
```
|
||||
|
||||
1. 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
|
||||
git remote set-url --push origin https://{% data variables.product.product_url %}/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.
|
||||
|
|
|
@ -28,18 +28,18 @@ Here's an example of an HTTPS error you might receive:
|
|||
|
||||
```shell
|
||||
> error: The requested URL returned error: 401 while accessing
|
||||
> https://{% data variables.command_line.codeblock %}/USER/REPO.git/info/refs?service=git-receive-pack
|
||||
> https://{% data variables.product.product_url %}/USER/REPO.git/info/refs?service=git-receive-pack
|
||||
> fatal: HTTP request failed
|
||||
```
|
||||
|
||||
```shell
|
||||
> Error: The requested URL returned error: 403 while accessing
|
||||
> https://{% data variables.command_line.codeblock %}/USER/REPO.git/info/refs
|
||||
> https://{% data variables.product.product_url %}/USER/REPO.git/info/refs
|
||||
> fatal: HTTP request failed
|
||||
```
|
||||
|
||||
```shell
|
||||
> Error: https://{% data variables.command_line.codeblock %}/USER/REPO.git/info/refs not found: did you run git
|
||||
> Error: https://{% data variables.product.product_url %}/USER/REPO.git/info/refs not found: did you run git
|
||||
> update-server-info on the server?
|
||||
```
|
||||
|
||||
|
@ -98,7 +98,7 @@ If you've previously set up SSH keys, you can use the SSH clone URL instead of H
|
|||
|
||||
### Check your spelling
|
||||
|
||||
Typos happen, and repository names are case-sensitive. If you try to clone `git@{% data variables.command_line.codeblock %}:user/repo.git`, but the repository is really named `User/Repo` you will receive this error.
|
||||
Typos happen, and repository names are case-sensitive. If you try to clone `git@{% data variables.product.product_url %}:user/repo.git`, but the repository is really named `User/Repo` you will receive this error.
|
||||
|
||||
To avoid this error, when cloning, always copy and paste the clone URL from the repository's page. For more information, see "[AUTOTITLE](/repositories/creating-and-managing-repositories/cloning-a-repository)."
|
||||
|
||||
|
@ -122,7 +122,7 @@ You should ensure that the SSH key you are using is attached to your personal ac
|
|||
the following into the command line:
|
||||
|
||||
```shell
|
||||
$ ssh -T git@{% data variables.command_line.codeblock %}
|
||||
$ ssh -T git@{% data variables.product.product_url %}
|
||||
> Hi USERNAME! You've successfully authenticated, but GitHub does not
|
||||
> provide shell access.
|
||||
```
|
||||
|
@ -152,7 +152,7 @@ This error occurs if the default branch of a repository has been deleted on {% d
|
|||
Detecting this error is simple; Git will warn you when you try to clone the repository:
|
||||
|
||||
```shell
|
||||
$ git clone https://{% data variables.command_line.codeblock %}/USER/REPO.git
|
||||
$ git clone https://{% data variables.product.product_url %}/USER/REPO.git
|
||||
# Clone a repo
|
||||
> Cloning into 'repo'...
|
||||
> remote: Counting objects: 66179, done.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
1. Type `git clone`, and then paste the URL you copied earlier.
|
||||
|
||||
```shell
|
||||
git clone https://{% data variables.command_line.codeblock %}/YOUR-USERNAME/YOUR-REPOSITORY
|
||||
git clone https://{% data variables.product.product_url %}/YOUR-USERNAME/YOUR-REPOSITORY
|
||||
```
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
1. Press **Enter** to create your local clone.
|
||||
|
||||
```shell
|
||||
$ git clone https://{% data variables.command_line.codeblock %}/YOUR-USERNAME/YOUR-REPOSITORY
|
||||
$ git clone https://{% data variables.product.product_url %}/YOUR-USERNAME/YOUR-REPOSITORY
|
||||
> Cloning into `Spoon-Knife`...
|
||||
> remote: Counting objects: 10, done.
|
||||
> remote: Compressing objects: 100% (8/8), done.
|
||||
|
|
|
@ -1,7 +0,0 @@
|
|||
# Use this variable wherever backticks are necessary
|
||||
backticks: >-
|
||||
{% ifversion fpt or ghec %}github.com{% else %}[hostname]{% endif %}
|
||||
|
||||
# Use this variable within codeblocks (because it includes HTML! Which only renders in shell codeblocks!)
|
||||
codeblock: >-
|
||||
{% ifversion fpt or ghec %}github.com{% else %}HOSTNAME{% endif %}
|
Загрузка…
Ссылка в новой задаче