1
0
mirror of synced 2025-12-25 02:17:36 -05:00

Consolidate product name variables for base URL (#50519)

This commit is contained in:
Laura Coursen
2024-05-09 08:19:08 -05:00
committed by GitHub
parent ffa3daf310
commit 52b841ba12
32 changed files with 114 additions and 121 deletions

View File

@@ -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)."