Merge branch 'main' into secret-scanning-ga
This commit is contained in:
@@ -36,7 +36,7 @@ jobs:
|
||||
issue_number: issueNumber
|
||||
})
|
||||
const teamMembers = await github.request(
|
||||
`/orgs/github/teams/docs/members`
|
||||
`/orgs/github/teams/docs/members?per_page=100`
|
||||
)
|
||||
const logins = teamMembers.data.map(member => member.login)
|
||||
// ignore PRs opened by docs bot accounts
|
||||
|
||||
@@ -5,7 +5,7 @@ name: Move and unlabel ready to merge issues
|
||||
# **Who does it impact**: Open source contributors, open-source maintainers.
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
pull_request_target:
|
||||
types:
|
||||
- labeled
|
||||
|
||||
|
||||
1
.github/workflows/openapi-decorate.yml
vendored
1
.github/workflows/openapi-decorate.yml
vendored
@@ -7,7 +7,6 @@ name: OpenAPI generate decorated schema files
|
||||
on:
|
||||
workflow_dispatch:
|
||||
pull_request:
|
||||
types: [opened]
|
||||
|
||||
jobs:
|
||||
generate-decorated-files:
|
||||
|
||||
2
.github/workflows/triage-pull-requests.yml
vendored
2
.github/workflows/triage-pull-requests.yml
vendored
@@ -5,7 +5,7 @@ name: Triage new pull requests
|
||||
# **Who does it impact**:
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
pull_request_target:
|
||||
types:
|
||||
- reopened
|
||||
- opened
|
||||
|
||||
3
.github/workflows/triage-stale-check.yml
vendored
3
.github/workflows/triage-stale-check.yml
vendored
@@ -21,7 +21,7 @@ jobs:
|
||||
days-before-pr-stale: 7
|
||||
days-before-pr-close: 3
|
||||
stale-pr-label: 'stale'
|
||||
exempt-pr-labels: 'waiting for review'
|
||||
exempt-pr-labels: 'waiting for review,never-stale'
|
||||
stale_staff:
|
||||
if: github.repository == 'github/docs'
|
||||
runs-on: ubuntu-latest
|
||||
@@ -40,3 +40,4 @@ jobs:
|
||||
# a comment being posted every 14 days as an infinite loop, which is what
|
||||
# we want
|
||||
stale-pr-label: 'waiting for review'
|
||||
exempt-pr-labels: 'never-stale'
|
||||
|
||||
16
.pa11yci
16
.pa11yci
@@ -13,17 +13,16 @@
|
||||
"http://localhost:4001/en/actions",
|
||||
"http://localhost:4001/en/github/authenticating-to-github/creating-a-personal-access-token",
|
||||
"http://localhost:4001/en/github/authenticating-to-github/checking-for-existing-ssh-keys",
|
||||
"http://localhost:4001/en/github/using-git/changing-a-remotes-url",
|
||||
"http://localhost:4001/en/github/getting-started-with-github/managing-remote-repositories",
|
||||
"http://localhost:4001/en/github/getting-started-with-github/set-up-git",
|
||||
"http://localhost:4001/en/github/creating-cloning-and-archiving-repositories/cloning-a-repository",
|
||||
"http://localhost:4001/en/github/writing-on-github/basic-writing-and-formatting-syntax",
|
||||
"http://localhost:4001/en/actions/reference/workflow-syntax-for-github-actions",
|
||||
"http://localhost:4001/en/github/using-git/which-remote-url-should-i-use",
|
||||
"http://localhost:4001/en/github/getting-started-with-github/about-remote-repositories",
|
||||
"http://localhost:4001/en/github/collaborating-with-issues-and-pull-requests/resolving-a-merge-conflict-using-the-command-line",
|
||||
"http://localhost:4001/en/github/using-git/setting-your-username-in-git",
|
||||
"http://localhost:4001/en/github/getting-started-with-github/setting-your-username-in-git",
|
||||
"http://localhost:4001/en/github/setting-up-and-managing-your-github-user-account/setting-your-commit-email-address",
|
||||
"http://localhost:4001/en/github/authenticating-to-github/configuring-two-factor-authentication",
|
||||
"http://localhost:4001/en/github/using-git/adding-a-remote",
|
||||
"http://localhost:4001/en/rest",
|
||||
"http://localhost:4001/en/github/working-with-github-pages/configuring-a-custom-domain-for-your-github-pages-site",
|
||||
"http://localhost:4001/en/github/collaborating-with-issues-and-pull-requests/about-pull-requests",
|
||||
@@ -55,7 +54,7 @@
|
||||
"http://localhost:4001/en/actions/getting-started-with-github-actions",
|
||||
"http://localhost:4001/en/actions/reference/events-that-trigger-workflows",
|
||||
"http://localhost:4001/en/desktop/getting-started-with-github-desktop/installing-github-desktop",
|
||||
"http://localhost:4001/en/github/using-git/ignoring-files",
|
||||
"http://localhost:4001/en/github/getting-started-with-github/ignoring-files",
|
||||
"http://localhost:4001/en/desktop",
|
||||
"http://localhost:4001/en/packages",
|
||||
"http://localhost:4001/en/actions/configuring-and-managing-workflows/configuring-a-workflow",
|
||||
@@ -71,7 +70,7 @@
|
||||
"http://localhost:4001/en/actions/reference/context-and-expression-syntax-for-github-actions",
|
||||
"http://localhost:4001/en/github/managing-files-in-a-repository/navigating-code-on-github",
|
||||
"http://localhost:4001/en/github/teaching-and-learning-with-github-education/applying-for-a-student-developer-pack",
|
||||
"http://localhost:4001/en/github/using-git/caching-your-github-credentials-in-git",
|
||||
"http://localhost:4001/en/github/getting-started-with-github/caching-your-github-credentials-in-git",
|
||||
"http://localhost:4001/en/github/collaborating-with-issues-and-pull-requests/creating-a-pull-request",
|
||||
"http://localhost:4001/en/github/setting-up-and-managing-your-github-user-account/inviting-collaborators-to-a-personal-repository",
|
||||
"http://localhost:4001/en/github/setting-up-and-managing-your-github-user-account/changing-your-github-username",
|
||||
@@ -81,7 +80,6 @@
|
||||
"http://localhost:4001/en/actions/configuring-and-managing-workflows/using-environment-variables",
|
||||
"http://localhost:4001/en/actions/configuring-and-managing-workflows/creating-and-storing-encrypted-secrets",
|
||||
"http://localhost:4001/en/github/authenticating-to-github/removing-sensitive-data-from-a-repository",
|
||||
"http://localhost:4001/en/github/using-git/removing-a-remote",
|
||||
"http://localhost:4001/en/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line",
|
||||
"http://localhost:4001/en/github/setting-up-and-managing-billing-and-payments-on-github/setting-your-billing-email",
|
||||
"http://localhost:4001/en/github/setting-up-and-managing-your-github-user-account",
|
||||
@@ -90,8 +88,8 @@
|
||||
"http://localhost:4001/en/github/authenticating-to-github/about-two-factor-authentication",
|
||||
"http://localhost:4001/en/github/working-with-github-pages/about-custom-domains-and-github-pages",
|
||||
"http://localhost:4001/en/github/searching-for-information-on-github/searching-code",
|
||||
"http://localhost:4001/en/github/using-git/configuring-git-to-handle-line-endings",
|
||||
"http://localhost:4001/en/github/using-git/getting-changes-from-a-remote-repository",
|
||||
"http://localhost:4001/en/github/getting-started-with-github/configuring-git-to-handle-line-endings",
|
||||
"http://localhost:4001/en/github/getting-started-with-github/getting-changes-from-a-remote-repository",
|
||||
"http://localhost:4001/en/github/authenticating-to-github/generating-a-new-gpg-key",
|
||||
"http://localhost:4001/en/github/authenticating-to-github/accessing-github-using-two-factor-authentication",
|
||||
"http://localhost:4001/en/github/creating-cloning-and-archiving-repositories/licensing-a-repository",
|
||||
|
||||
@@ -15,7 +15,7 @@ versions:
|
||||
|
||||
Jobs that reference an environment configured with required reviewers will wait for an approval before starting. While a job is awaiting approval, it has a status of "Waiting". If a job is not approved within 30 days, the workflow run will be automatically canceled.
|
||||
|
||||
For more information about environments and required approvals, see "[Environments](/actions/reference/environments)." For information about how to review deployments with the REST API, see "[Workflow Runs](/rest/reference/actions#workflow-runs)."
|
||||
For more information about environments and required approvals, see "[Environments](/actions/reference/environments)."{% if currentVersion == "free-pro-team@latest" or currentVersion == "github-ae@next" or currentVersion ver_gt "enterprise-server@3.1" %} For information about how to review deployments with the REST API, see "[Workflow Runs](/rest/reference/actions#workflow-runs)."{% endif %}
|
||||
|
||||
### Approving or rejecting a job
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ Environment protection rules and environment secrets are only available on publi
|
||||
|
||||
#### Environment protection rules
|
||||
|
||||
Environment protection rules require specific conditions to pass before a job referencing the environment can proceed. You can use environment protection rules to require a manual approval, delay a job, or restrict the environment to certain branches.
|
||||
Environment protection rules require specific conditions to pass before a job referencing the environment can proceed. {% if currentVersion == "free-pro-team@latest" or currentVersion == "github-ae@next" or currentVersion ver_gt "enterprise-server@3.1" %}You can use environment protection rules to require a manual approval, delay a job, or restrict the environment to certain branches.{% else %}You can use environment protection rules to require a manual approval or delay a job.{% endif %}
|
||||
|
||||
##### Required reviewers
|
||||
|
||||
@@ -33,6 +33,7 @@ For more information on reviewing jobs that reference an environment with requir
|
||||
|
||||
Use a wait timer to delay a job for a specific amount of time after the job is initially triggered. The time (in minutes) must be an integer between 0 and 43,200 (30 days).
|
||||
|
||||
{% if currentVersion == "free-pro-team@latest" or currentVersion == "github-ae@next" or currentVersion ver_gt "enterprise-server@3.1" %}
|
||||
##### Deployment branches
|
||||
|
||||
Use deployment branches to restrict which branches can deploy to the environment. Below are the options for deployment branches for an environment:
|
||||
@@ -42,7 +43,7 @@ Use deployment branches to restrict which branches can deploy to the environment
|
||||
* **Selected branches**: Only branches that match your specified name patterns can deploy to the environment.
|
||||
|
||||
For example, if you specify `releases/*` as a deployment branch rule, only branches whose name begins with `releases/` can deploy to the environment. (Wildcard characters will not match `/`. To match branches that begin with `release/` and contain an additional single slash, use `release/*/*`.) If you add `main` as a deployment branch rule, a branch named `main` can also deploy to the environment. For more information about syntax options for deployment branches, see the [Ruby File.fnmatch documentation](https://ruby-doc.org/core-2.5.1/File.html#method-c-fnmatch).
|
||||
|
||||
{% endif %}
|
||||
#### Environment secrets
|
||||
|
||||
Secrets stored in an environment are only available to workflow jobs that reference the environment. If the environment requires approval, a job cannot access environment secrets until one of the required reviewers approves it. For more information about secrets, see "[Encrypted secrets](/actions/reference/encrypted-secrets)."
|
||||
@@ -58,7 +59,7 @@ Secrets stored in an environment are only available to workflow jobs that refere
|
||||
1. Enter a name for the environment, then click **Configure environment**. Environment names are not case sensitive. An environment name may not exceed 255 characters and must be unique within the repository.
|
||||
1. Configure any environment protection rules or environment secrets.
|
||||
|
||||
You can also create and configure environments through the REST API. For more information, see "[Environments](/rest/reference/repos#environments)" and "[Secrets](/rest/reference/actions#secrets)."
|
||||
{% if currentVersion == "free-pro-team@latest" or currentVersion == "github-ae@next" or currentVersion ver_gt "enterprise-server@3.1" %}You can also create and configure environments through the REST API. For more information, see "[Environments](/rest/reference/repos#environments)" and "[Secrets](/rest/reference/actions#secrets)."{% endif %}
|
||||
|
||||
Running a workflow that references an environment that does not exist will create an environment with the referenced name. The newly created environment will not have any protection rules or secrets configured. Anyone that can edit workflows in the repository can create environments via a workflow file, but only repository admins can configure the environment.
|
||||
|
||||
@@ -82,4 +83,4 @@ Deleting an environment will delete all secrets and protection rules associated
|
||||
1. Next the the environment that you want to delete, click {% octicon "trashcan" aria-label="The trashcan icon" %}.
|
||||
2. Click **I understand, delete this environment**.
|
||||
|
||||
You can also delete environments through the REST API. For more information, see "[Environments](/rest/reference/repos#environments)."
|
||||
{% if currentVersion == "free-pro-team@latest" or currentVersion == "github-ae@next" or currentVersion ver_gt "enterprise-server@3.1" %}You can also delete environments through the REST API. For more information, see "[Environments](/rest/reference/repos#environments)."{% endif %}
|
||||
|
||||
@@ -44,4 +44,4 @@ You can change how a fork behaves with the upstream repository in {% data variab
|
||||
{% data reusables.desktop.select-fork-behavior %}
|
||||
|
||||
### Further reading
|
||||
- [About remote repositories](/github/using-git/about-remote-repositories)
|
||||
- [About remote repositories](/github/getting-started-with-github/about-remote-repositories)
|
||||
|
||||
@@ -15,7 +15,7 @@ When you pull to your local branch, you only update your local copy of the repos
|
||||
|
||||
To add changes from one branch to another branch, you can merge the branches. To apply changes to your branch from another branch in the same repository, you can merge the other branch into your branch on {% data variables.product.prodname_desktop %}. To request that changes from your branch are merged into another branch, in the same repository or in another repository in the network, you can create a pull request on {% data variables.product.prodname_desktop %}. For more information, see "[Merging another branch into your project branch](#merging-another-branch-into-your-project-branch)" and "[About pull requests](/github/collaborating-with-issues-and-pull-requests/about-pull-requests)."
|
||||
|
||||
Some workflows require or benefit from rebasing instead of merging. By rebasing you can reorder, edit, or squash commits together. For more information, see "[About Git rebase](/articles/about-git-rebase)" and "[Rebasing your project branch onto another branch](#rebasing-your-project-branch-onto-another-branch)."
|
||||
Some workflows require or benefit from rebasing instead of merging. By rebasing you can reorder, edit, or squash commits together. For more information, see "[About Git rebase](/github/getting-started-with-github/about-git-rebase)" and "[Rebasing your project branch onto another branch](#rebasing-your-project-branch-onto-another-branch)."
|
||||
|
||||
### Pulling to your local branch from the remote
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ versions:
|
||||
|
||||
After you authenticate to {% data variables.product.prodname_dotcom %}, you can connect to remote repositories with {% data variables.product.prodname_desktop %}. {% data variables.product.prodname_desktop %} caches your credentials (username and password or personal access token) and uses the credentials to authenticate for each connection to the remote repository.
|
||||
|
||||
{% data variables.product.prodname_desktop %} connects to {% data variables.product.prodname_dotcom %} using HTTPS. If you use {% data variables.product.prodname_desktop %} to access repositories that were cloned using SSH, you may encounter errors. To connect to a repository that was cloned using SSH, change the remote's URLs. For more information, see "[Changing a remote's URL](/github/using-git/changing-a-remotes-url)."
|
||||
{% data variables.product.prodname_desktop %} connects to {% data variables.product.prodname_dotcom %} using HTTPS. If you use {% data variables.product.prodname_desktop %} to access repositories that were cloned using SSH, you may encounter errors. To connect to a repository that was cloned using SSH, change the remote's URLs. For more information, see "[Managing remote repositories](/github/getting-started-with-github/managing-remote-repositories)."
|
||||
|
||||
### Further reading
|
||||
- "[Cloning and forking repositories from GitHub Desktop](/desktop/contributing-and-collaborating-using-github-desktop/cloning-and-forking-repositories-from-github-desktop)"
|
||||
|
||||
@@ -42,7 +42,7 @@ If you do not wish to create and clone a tutorial repository, you can create a n
|
||||
- "Description" is an optional field that you can use to provide more information about the purpose of your repository.
|
||||
- "Local path" sets the location of your repository on your computer. By default, {% data variables.product.prodname_desktop %} creates a _GitHub_ folder inside your _Documents_ folder to store your repositories, but you can choose any location on your computer. Your new repository will be a folder inside the chosen location. For example, if you name your repository `Tutorial`, a folder named _Tutorial_ is created inside the folder you selected for your local path. {% data variables.product.prodname_desktop %} remembers your chosen location the next time you create or clone a new repository.
|
||||
- **Initialize this repository with a README** creates an initial commit with a _README.md_ file. READMEs helps people understand the purpose of your project, so we recommend selecting this and filling it out with helpful information. When someone visits your repository on {% data variables.product.product_name %}, the README is the first thing they'll see as they learn about your project. For more information, see "[About READMEs](/articles/about-readmes)."
|
||||
- The **Git ignore** drop-down menu lets you add a custom file to ignore specific files in your local repository that you don't want to store in version control. If there's a specific language or framework that you'll be using, you can select an option from the available list. If you're just getting started, feel free to skip this selection. For more information, see "[Ignoring files](/articles/ignoring-files)."
|
||||
- The **Git ignore** drop-down menu lets you add a custom file to ignore specific files in your local repository that you don't want to store in version control. If there's a specific language or framework that you'll be using, you can select an option from the available list. If you're just getting started, feel free to skip this selection. For more information, see "[Ignoring files](/github/getting-started-with-github/ignoring-files)."
|
||||
- The **License** drop-down menu lets you add an open-source license to a _LICENSE_ file in your repository. You don't need to worry about adding a license right away. For more information about available open-source licenses and how to add them to your repository, see "[Licensing a repository](/articles/licensing-a-repository)."
|
||||
3. Click **Create repository**.
|
||||
|
||||
@@ -107,6 +107,6 @@ Now that you've created and published your repository, you're ready to make chan
|
||||
You've now created a repository, published the repository to {% data variables.product.product_name %}, made a commit, and pushed your changes to {% data variables.product.product_name %}. You can follow this same workflow when contributing to other projects that you create or collaborate on.
|
||||
|
||||
### Further reading
|
||||
- "[Learning about Git](/github/using-git/learning-about-git)"
|
||||
- "[Getting started with Git](/github/getting-started-with-github/getting-started-with-git)"
|
||||
- "[Learning about {% data variables.product.prodname_dotcom %}](/github/getting-started-with-github/learning-about-github)"
|
||||
- "[Getting started with {% data variables.product.prodname_dotcom %}](/github/getting-started-with-github)"
|
||||
|
||||
@@ -13,7 +13,7 @@ This guide will help you get started with {% data variables.product.prodname_des
|
||||
|
||||
You might find it helpful to have a basic understanding of Git and {% data variables.product.prodname_dotcom %} before getting started with {% data variables.product.prodname_desktop %}. For more information, see the following articles.
|
||||
|
||||
- "[Learning about Git](/github/using-git/learning-about-git)"
|
||||
- "[Using Git](/github/getting-started-with-github/using-git)"
|
||||
- "[Learning about {% data variables.product.prodname_dotcom %}](/github/getting-started-with-github/learning-about-github)"
|
||||
- "[Getting started with {% data variables.product.prodname_dotcom %}](/github/getting-started-with-github)"
|
||||
|
||||
|
||||
@@ -724,7 +724,7 @@ The RuboCop tool [offers](https://docs.rubocop.org/rubocop/usage/basic_usage.htm
|
||||
|
||||
To push to a repository, your app must have write permissions for "Repository contents." You set that permission back in [Step 2.2. Cloning the repository](#step-22-cloning-the-repository) to **Read & write**, so you're all set.
|
||||
|
||||
In order to commit files, Git must know which [username](/articles/setting-your-username-in-git/) and [email](/articles/setting-your-commit-email-address-in-git/) to associate with the commit. Add two more environment variables in your `.env` file to store the name (`GITHUB_APP_USER_NAME`) and email (`GITHUB_APP_USER_EMAIL`) settings. Your name can be the name of your app and the email can be any email you'd like for this example. For example:
|
||||
In order to commit files, Git must know which [username](/github/getting-started-with-github/setting-your-username-in-git/) and [email](/articles/setting-your-commit-email-address-in-git/) to associate with the commit. Add two more environment variables in your `.env` file to store the name (`GITHUB_APP_USER_NAME`) and email (`GITHUB_APP_USER_EMAIL`) settings. Your name can be the name of your app and the email can be any email you'd like for this example. For example:
|
||||
|
||||
```ini
|
||||
GITHUB_APP_USER_NAME=Octoapp
|
||||
|
||||
@@ -140,7 +140,7 @@ After you create your app, you'll be taken back to the [app settings page](https
|
||||
|
||||
### Step 4. Prepare the runtime environment
|
||||
|
||||
To keep your information secure, we recommend putting all your app-related secrets in your computer's memory where your app can find them, rather than putting them directly in your code. A handy development tool called [dotenv](https://github.com/bkeepers/dotenv) loads project-specific environment variables from a `.env` file to `ENV`. Never check your `.env` file into GitHub. This is a local file that stores sensitive information that you don't want on the public internet. The `.env` file is already included in the repository's [`.gitignore`](/articles/ignoring-files/) file to prevent that.
|
||||
To keep your information secure, we recommend putting all your app-related secrets in your computer's memory where your app can find them, rather than putting them directly in your code. A handy development tool called [dotenv](https://github.com/bkeepers/dotenv) loads project-specific environment variables from a `.env` file to `ENV`. Never check your `.env` file into GitHub. This is a local file that stores sensitive information that you don't want on the public internet. The `.env` file is already included in the repository's [`.gitignore`](/github/getting-started-with-github/ignoring-files/) file to prevent that.
|
||||
|
||||
The template code you downloaded in the [Prerequisites section](#prerequisites) already has an example file called `.env-example`. Rename the example file from `.env-example` to `.env` or create a copy of the `.env-example` file called `.env`. You haven't installed dotenv yet, but you will install it later in this quickstart when you run `bundle install`. **Note:** Quickstarts that reference the steps in this guide may include additional environment variables in the `.env-example` file. Reference the quickstart guide for the project you've cloned on GitHub for guidance setting those additional environment variables.
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ To protect your customers, we recommend that you also follow security best pract
|
||||
|
||||
### Requirements for paid apps
|
||||
|
||||
To publish a paid plan for your app on {% data variables.product.prodname_marketplace %}, your app must be owned by an organization that is a verified publisher. For more information about the verification process or transfering ownership of your app, see "[Applying for publisher verification for your organization](/developers/github-marketplace/applying-for-publisher-verification-for-your-organization)."
|
||||
To publish a paid plan for your app on {% data variables.product.prodname_marketplace %}, your app must be owned by an organization that is a verified publisher. For more information about the verification process or transferring ownership of your app, see "[Applying for publisher verification for your organization](/developers/github-marketplace/applying-for-publisher-verification-for-your-organization)."
|
||||
|
||||
If your app is already published and you're a verified publisher, then you can publish a new paid plan from the pricing plan editor. For more information, see "[Setting pricing plans for your listing](/developers/github-marketplace/setting-pricing-plans-for-your-listing)."
|
||||
|
||||
|
||||
@@ -165,7 +165,7 @@ Name | Type | Description
|
||||
`tree` | `object` | The Git tree of the commit.
|
||||
`message` | `string` | The commit message.
|
||||
`parents` | `array of objects` | A list of parent commits.
|
||||
`verfication` | `object` | The result of verifying the commit's signature. For more information, see "[Signature verification object](/rest/reference/git#get-a-commit)."
|
||||
`verification` | `object` | The result of verifying the commit's signature. For more information, see "[Signature verification object](/rest/reference/git#get-a-commit)."
|
||||
`event` | `string` | The event value is `"committed"`.
|
||||
|
||||
### connected
|
||||
|
||||
@@ -132,7 +132,7 @@ You can see the teams that are working on or have submitted an assignment in the
|
||||
|
||||
### Next steps
|
||||
|
||||
- After you create the assignment and your students form teams, team members can start work on the assignment using Git and {% data variables.product.product_name %}'s features. Students can clone the repository, push commits, manage branches, create and review pull requests, address merge conflicts, and discuss changes with issues. Both you and the team can review the commit history for the repository. For more information, see "[Getting started with {% data variables.product.prodname_dotcom %}](/github/getting-started-with-github)," "[Creating, cloning, and archiving repositories](/github/creating-cloning-and-archiving-repositories)," "[Using Git](/github/using-git)," and "[Collaborating with issues and pull requests](/github/collaborating-with-issues-and-pull-requests)," and the free course on [managing merge conflicts](https://lab.github.com/githubtraining/managing-merge-conflicts) from {% data variables.product.prodname_learning %}.
|
||||
- After you create the assignment and your students form teams, team members can start work on the assignment using Git and {% data variables.product.product_name %}'s features. Students can clone the repository, push commits, manage branches, create and review pull requests, address merge conflicts, and discuss changes with issues. Both you and the team can review the commit history for the repository. For more information, see "[Getting started with {% data variables.product.prodname_dotcom %}](/github/getting-started-with-github)," "[Creating, cloning, and archiving repositories](/github/creating-cloning-and-archiving-repositories)," "[Using Git](/github/getting-started-with-github/using-git)," and "[Collaborating with issues and pull requests](/github/collaborating-with-issues-and-pull-requests)," and the free course on [managing merge conflicts](https://lab.github.com/githubtraining/managing-merge-conflicts) from {% data variables.product.prodname_learning %}.
|
||||
|
||||
- When a team finishes an assignment, you can review the files in the repository, or you can review the history and visualizations for the repository to better understand how the team collaborated. For more information, see "[Visualizing repository data with graphs](/github/visualizing-repository-data-with-graphs)."
|
||||
|
||||
|
||||
@@ -112,7 +112,7 @@ You can see whether a student has joined the classroom and accepted or submitted
|
||||
|
||||
### Next steps
|
||||
|
||||
- Once you create the assignment, students can start work on the assignment using Git and {% data variables.product.product_name %}'s features. Students can clone the repository, push commits, manage branches, create and review pull requests, address merge conflicts, and discuss changes with issues. Both you and student can review the commit history for the repository. For more information, see "[Getting started with {% data variables.product.prodname_dotcom %}](/github/getting-started-with-github)," "[Creating, cloning, and archiving repositories](/github/creating-cloning-and-archiving-repositories)," "[Using Git](/github/using-git)," and "[Collaborating with issues and pull requests](/github/collaborating-with-issues-and-pull-requests)."
|
||||
- Once you create the assignment, students can start work on the assignment using Git and {% data variables.product.product_name %}'s features. Students can clone the repository, push commits, manage branches, create and review pull requests, address merge conflicts, and discuss changes with issues. Both you and student can review the commit history for the repository. For more information, see "[Getting started with {% data variables.product.prodname_dotcom %}](/github/getting-started-with-github)," "[Creating, cloning, and archiving repositories](/github/creating-cloning-and-archiving-repositories)," "[Using Git](/github/getting-started-with-github/using-git)," and "[Collaborating with issues and pull requests](/github/collaborating-with-issues-and-pull-requests)."
|
||||
|
||||
- When a student finishes an assignment, you can review the files in the repository, or you can review the history and visualizations for the repository to better understand the student's work. For more information, see "[Visualizing repository data with graphs](/github/visualizing-repository-data-with-graphs)."
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ In addition to redirecting web traffic, all `git clone`, `git fetch`, or `git pu
|
||||
$ git remote set-url origin <em>new_url</em>
|
||||
```
|
||||
|
||||
For more information, see "[Changing a Remote's URL](/github/using-git/changing-a-remotes-url)."
|
||||
For more information, see "[Managing remote repositories](/github/getting-started-with-github/managing-remote-repositories)."
|
||||
|
||||
{% if currentVersion == "free-pro-team@latest" %}
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ When you transfer a repository, its issues, pull requests, wiki, stars, and watc
|
||||
$ git remote set-url origin <em>new_url</em>
|
||||
```
|
||||
|
||||
For more information, see "[Changing a remote's URL](/articles/changing-a-remote-s-url)".
|
||||
For more information, see "[Managing remote repositories](/github/getting-started-with-github/managing-remote-repositories)."
|
||||
|
||||
#### Repository transfers and organizations
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ After you enable required status checks, your branch may need to be up-to-date w
|
||||
|
||||
{% note %}
|
||||
|
||||
**Note:** You can also bring your branch up to date with the base branch using Git rebase. For more information, see "[About Git rebase](/github/using-git/about-git-rebase)."
|
||||
**Note:** You can also bring your branch up to date with the base branch using Git rebase. For more information, see "[About Git rebase](/github/getting-started-with-github/about-git-rebase)."
|
||||
|
||||
{% endnote %}
|
||||
|
||||
|
||||
@@ -48,9 +48,9 @@ You can authenticate with the API in different ways.
|
||||
|
||||
### Authenticating with the command line
|
||||
|
||||
You can access repositories on {% data variables.product.product_name %} from the command line in two ways, HTTPS and SSH, and both have a different way of authenticating. The method of authenticating is determined based on whether you choose an HTTPS or SSH remote URL when you clone the repository. For more information about which way to access, see "[Which remote URL should I use?](/github/using-git/which-remote-url-should-i-use)"
|
||||
You can access repositories on {% data variables.product.product_name %} from the command line in two ways, HTTPS and SSH, and both have a different way of authenticating. The method of authenticating is determined based on whether you choose an HTTPS or SSH remote URL when you clone the repository. For more information about which way to access, see "[About remote repositories](/github/getting-started-with-github/about-remote-repositories)."
|
||||
|
||||
* You can work with all repositories on {% data variables.product.product_name %} over HTTPS, even if you are behind a firewall or proxy. Every time you use Git to authenticate with {% data variables.product.product_name %}, you'll be prompted to enter your credentials to authenticate with {% data variables.product.product_name %}, unless you cache them with a [credential helper](/github/using-git/caching-your-github-credentials-in-git). {% data reusables.user_settings.password-authentication-deprecation %}
|
||||
* You can work with all repositories on {% data variables.product.product_name %} over HTTPS, even if you are behind a firewall or proxy. Every time you use Git to authenticate with {% data variables.product.product_name %}, you'll be prompted to enter your credentials to authenticate with {% data variables.product.product_name %}, unless you cache them with a [credential helper](/github/getting-started-with-github/caching-your-github-credentials-in-git). {% data reusables.user_settings.password-authentication-deprecation %}
|
||||
|
||||
* You can work with all repositories on {% data variables.product.product_name %} over SSH, although firewalls and proxys might refuse to allow SSH connections. Using SSH requires you to generate an SSH public/private keypair on your local machine and add the public key to your {% data variables.product.product_name %} account. Every time you use Git to authenticate with {% data variables.product.product_name %}, you'll be prompted to enter your SSH key passphrase, unless you've [stored the key](/github/authenticating-to-github/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent#adding-your-ssh-key-to-the-ssh-agent). For more information, see "[Generating a new SSH key and adding it to the ssh-agent](/github/authenticating-to-github/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent)."
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ Before adding a new SSH key to your {% data variables.product.product_name %} ac
|
||||
* [Checked for existing SSH keys](/articles/checking-for-existing-ssh-keys)
|
||||
* [Generated a new SSH key and added it to the ssh-agent](/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent)
|
||||
|
||||
After adding a new SSH key to your {% data variables.product.product_name %} account, you can reconfigure any local repositories to use SSH. For more information, see "[Switching remote URLs from HTTPS to SSH](/articles/changing-a-remote-s-url/#switching-remote-urls-from-https-to-ssh)."
|
||||
After adding a new SSH key to your {% data variables.product.product_name %} account, you can reconfigure any local repositories to use SSH. For more information, see "[Switching remote URLs from HTTPS to SSH](/github/getting-started-with-github/managing-remote-repositories/#switching-remote-urls-from-https-to-ssh)."
|
||||
|
||||
{% data reusables.ssh.dsa-support %}
|
||||
|
||||
|
||||
@@ -54,7 +54,7 @@ Personal access tokens (PATs) are an alternative to using passwords for authenti
|
||||
|
||||
{% data reusables.command_line.providing-token-as-password %}
|
||||
|
||||
Personal access tokens can only be used for HTTPS Git operations. If your repository uses an SSH remote URL, you will need to [switch the remote from SSH to HTTPS](/articles/changing-a-remote-s-url/#switching-remote-urls-from-ssh-to-https).
|
||||
Personal access tokens can only be used for HTTPS Git operations. If your repository uses an SSH remote URL, you will need to [switch the remote from SSH to HTTPS](/github/getting-started-with-github/managing-remote-repositories/#switching-remote-urls-from-ssh-to-https).
|
||||
|
||||
If you are not prompted for your username and password, your credentials may be cached on your computer. You can [update your credentials in the Keychain](/articles/updating-credentials-from-the-osx-keychain) to replace your old password with the token.
|
||||
|
||||
|
||||
@@ -30,5 +30,5 @@ You can only use your password to log on to {% data variables.product.product_na
|
||||
|
||||
### Further reading
|
||||
|
||||
- "[Caching your {% data variables.product.product_name %} credentials in Git](/github/using-git/caching-your-github-credentials-in-git/)"
|
||||
- "[Caching your {% data variables.product.product_name %} credentials in Git](/github/getting-started-with-github/caching-your-github-credentials-in-git/)"
|
||||
- "[Keeping your account and data secure](/articles/keeping-your-account-and-data-secure/)"
|
||||
|
||||
@@ -26,7 +26,7 @@ $ ssh -vT git@{% data variables.command_line.codeblock %}
|
||||
|
||||
#### Use HTTPS
|
||||
|
||||
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](/articles/which-remote-url-should-i-use) you're using:
|
||||
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](/github/getting-started-with-github/about-remote-repositories) you're using:
|
||||
|
||||
```shell
|
||||
$ git clone https://{% data variables.command_line.codeblock %}/<em>username</em>/<em>reponame</em>.git
|
||||
|
||||
@@ -40,7 +40,7 @@ All connections, including those for remote URLs, must be made as the "git" user
|
||||
$ ssh -T <em>GITHUB-USERNAME</em>@{% data variables.command_line.codeblock %}
|
||||
> Permission denied (publickey).
|
||||
```
|
||||
If your connection failed and you're using a remote URL with your {% data variables.product.product_name %} username, you can [change the remote URL to use the "git" user](/articles/changing-a-remote-s-url/).
|
||||
If your connection failed and you're using a remote URL with your {% data variables.product.product_name %} username, you can [change the remote URL to use the "git" user](/github/getting-started-with-github/managing-remote-repositories).
|
||||
|
||||
You should verify your connection by typing:
|
||||
|
||||
|
||||
@@ -30,12 +30,12 @@ If you [configured your SSH passphrase with the OS X Keychain](/articles/working
|
||||
|
||||
{% windows %}
|
||||
|
||||
If you lose your SSH key passphrase, there's no way to recover it. You'll need to [generate a brand new SSH keypair](/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent) or [switch to HTTPS cloning](/articles/changing-a-remote-s-url/#switching-remote-urls-from-ssh-to-https) so you can use your GitHub password instead.
|
||||
If you lose your SSH key passphrase, there's no way to recover it. You'll need to [generate a brand new SSH keypair](/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent) or [switch to HTTPS cloning](/github/getting-started-with-github/managing-remote-repositories) so you can use your GitHub password instead.
|
||||
|
||||
{% endwindows %}
|
||||
|
||||
{% linux %}
|
||||
|
||||
If you lose your SSH key passphrase, there's no way to recover it. You'll need to [generate a brand new SSH keypair](/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent) or [switch to HTTPS cloning](/articles/which-remote-url-should-i-use/#cloning-with-https-urls) so you can use your GitHub password instead.
|
||||
If you lose your SSH key passphrase, there's no way to recover it. You'll need to [generate a brand new SSH keypair](/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent) or [switch to HTTPS cloning](/github/getting-started-with-github/about-remote-repositories/#cloning-with-https-urls) so you can use your GitHub password instead.
|
||||
|
||||
{% endlinux %}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
title: Using SSH over the HTTPS port
|
||||
intro: 'Sometimes, firewalls refuse to allow SSH connections entirely. If using [HTTPS cloning with credential caching](/github/using-git/caching-your-github-credentials-in-git) is not an option, you can attempt to clone using an SSH connection made over the HTTPS port. Most firewall rules should allow this, but proxy servers may interfere.'
|
||||
intro: 'Sometimes, firewalls refuse to allow SSH connections entirely. If using [HTTPS cloning with credential caching](/github/getting-started-with-github/caching-your-github-credentials-in-git) is not an option, you can attempt to clone using an SSH connection made over the HTTPS port. Most firewall rules should allow this, but proxy servers may interfere.'
|
||||
redirect_from:
|
||||
- /articles/using-ssh-over-the-https-port
|
||||
versions:
|
||||
|
||||
@@ -70,7 +70,7 @@ For example, if you and another person both edited the file _styleguide.md_ on t
|
||||
$ 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](/articles/pushing-commits-to-a-remote-repository/) on {% data variables.product.product_name %} and [merge your changes](/articles/merging-a-pull-request/) in a pull request.
|
||||
You can now merge the branches on the command line or [push your changes to your remote repository](/github/getting-started-with-github/pushing-commits-to-a-remote-repository/) on {% data variables.product.product_name %} and [merge your changes](/articles/merging-a-pull-request/) in a pull request.
|
||||
|
||||
### Removed file merge conflicts
|
||||
|
||||
@@ -119,7 +119,7 @@ For example, if you edited a file, such as *README.md*, and another person remov
|
||||
> [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](/articles/pushing-commits-to-a-remote-repository/) on {% data variables.product.product_name %} and [merge your changes](/articles/merging-a-pull-request/) in a pull request.
|
||||
You can now merge the branches on the command line or [push your changes to your remote repository](/github/getting-started-with-github/pushing-commits-to-a-remote-repository/) on {% data variables.product.product_name %} and [merge your changes](/articles/merging-a-pull-request/) in a pull request.
|
||||
|
||||
### Further reading
|
||||
|
||||
|
||||
@@ -51,6 +51,6 @@ Before you can sync your fork with an upstream repository, you must [configure a
|
||||
|
||||
{% tip %}
|
||||
|
||||
**Tip**: Syncing your fork only updates your local copy of the repository. To update your fork on {% data variables.product.product_location %}, you must [push your changes](/articles/pushing-commits-to-a-remote-repository/).
|
||||
**Tip**: Syncing your fork only updates your local copy of the repository. To update your fork on {% data variables.product.product_location %}, you must [push your changes](/github/getting-started-with-github/pushing-commits-to-a-remote-repository/).
|
||||
|
||||
{% endtip %}
|
||||
|
||||
@@ -19,7 +19,7 @@ You can add a co-author on any commits you collaborate on. For more information,
|
||||
{% if currentVersion == "free-pro-team@latest" %}
|
||||
You can also create a commit on behalf of an organization. For more information, see "[Creating a commit on behalf of an organization](/github/committing-changes-to-your-project/creating-a-commit-on-behalf-of-an-organization)."{% endif %}
|
||||
|
||||
Rebasing allows you to change a series of commits and can modify the order of the commits in your timeline. For more information, see "[About git rebase](/github/using-git/about-git-rebase)."
|
||||
Rebasing allows you to change a series of commits and can modify the order of the commits in your timeline. For more information, see "[About git rebase](/github/getting-started-with-github/about-git-rebase)."
|
||||
|
||||
### Further reading
|
||||
- "[Committing and reviewing changes to your project](/desktop/contributing-to-projects/committing-and-reviewing-changes-to-your-project#about-commits)" on {% data variables.product.prodname_desktop %}
|
||||
|
||||
@@ -47,7 +47,7 @@ Organization's can use the `name@organization.com` email as a public point of co
|
||||
on-behalf-of: <em>@org</em> <<em>name@organization.com</em>>"
|
||||
```
|
||||
|
||||
The new commit, message, and badge will appear on {% data variables.product.product_location %} the next time you push. For more information, see "[Pushing changes to a remote repository](/articles/pushing-commits-to-a-remote-repository/)."
|
||||
The new commit, message, and badge will appear on {% data variables.product.product_location %} the next time you push. For more information, see "[Pushing changes to a remote repository](/github/getting-started-with-github/pushing-commits-to-a-remote-repository/)."
|
||||
|
||||
### Creating commits with an `on-behalf-of` badge on {% data variables.product.product_name %}
|
||||
|
||||
|
||||
@@ -62,7 +62,7 @@ You can use {% data variables.product.prodname_desktop %} to create a commit wit
|
||||
Co-authored-by: <em>another-name</em> <<em>another-name@example.com</em>>"
|
||||
```
|
||||
|
||||
The new commit and message will appear on {% data variables.product.product_location %} the next time you push. For more information, see "[Pushing changes to a remote repository](/articles/pushing-commits-to-a-remote-repository/)."
|
||||
The new commit and message will appear on {% data variables.product.product_location %} the next time you push. For more information, see "[Pushing changes to a remote repository](/github/getting-started-with-github/pushing-commits-to-a-remote-repository/)."
|
||||
|
||||
### Creating co-authored commits on {% data variables.product.product_name %}
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ topics:
|
||||
|
||||
You can clone a repository from {% data variables.product.product_location %} to your local computer to make it easier to fix merge conflicts, add or remove files, and push larger commits. When you clone a repository, you copy the repository from {% data variables.product.product_location %} to your local machine.
|
||||
|
||||
Cloning a repository pulls down a full copy of all the repository data that {% data variables.product.product_location %} has at that point in time, including all versions of every file and folder for the project. You can push your changes to the remote repository on {% data variables.product.product_location %}, or pull other people's changes from {% data variables.product.product_location %}. For more information, see "[Using common Git commands](/github/using-git/using-common-git-commands)".
|
||||
Cloning a repository pulls down a full copy of all the repository data that {% data variables.product.product_location %} has at that point in time, including all versions of every file and folder for the project. You can push your changes to the remote repository on {% data variables.product.product_location %}, or pull other people's changes from {% data variables.product.product_location %}. For more information, see "[Using Git](/github/getting-started-with-github/using-git)".
|
||||
|
||||
You can clone your existing repository or clone another person's existing repository to contribute to a project.
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ topics:
|
||||
{% data reusables.repositories.choose-repo-visibility %}
|
||||
6. If you're not using a template, there are a number of optional items you can pre-populate your repository with. If you're importing an existing repository to {% data variables.product.product_name %}, don't choose any of these options, as you may introduce a merge conflict. You can add or create new files using the user interface or choose to add new files using the command line later. For more information, see "[Importing a Git repository using the command line](/articles/importing-a-git-repository-using-the-command-line/)," "[Adding a file to a repository using the command line](/articles/adding-a-file-to-a-repository-using-the-command-line)," and "[Addressing merge conflicts](/articles/addressing-merge-conflicts/)."
|
||||
- You can create a README, which is a document describing your project. For more information, see "[About READMEs](/articles/about-readmes/)."
|
||||
- You can create a *.gitignore* file, which is a set of ignore rules. For more information, see "[Ignoring files](/articles/ignoring-files)."{% if currentVersion == "free-pro-team@latest" %}
|
||||
- You can create a *.gitignore* file, which is a set of ignore rules. For more information, see "[Ignoring files](/github/getting-started-with-github/ignoring-files)."{% if currentVersion == "free-pro-team@latest" %}
|
||||
- You can choose to add a software license for your project. For more information, see "[Licensing a repository](/articles/licensing-a-repository)."{% endif %}
|
||||
{% data reusables.repositories.select-marketplace-apps %}
|
||||
{% data reusables.repositories.create-repo %}
|
||||
|
||||
@@ -17,7 +17,7 @@ Typos happen, and repository names are case-sensitive. If you try to clone `git
|
||||
|
||||
To avoid this error, when cloning, always copy and paste the clone URL from the repository's page. For more information, see "[Cloning a repository](/articles/cloning-a-repository)."
|
||||
|
||||
To update the remote on an existing repository, see "[Changing a remote's URL](/articles/changing-a-remote-s-url)".
|
||||
To update the remote on an existing repository, see "[Managing remote repositories](/github/getting-started-with-github/managing-remote-repositories)".
|
||||
|
||||
### Checking your permissions
|
||||
|
||||
|
||||
@@ -75,10 +75,10 @@ When prompted for a username and password, make sure you use an account that has
|
||||
|
||||
{% tip %}
|
||||
|
||||
**Tip**: If you don't want to enter your credentials every time you interact with the remote repository, you can turn on [credential caching](/github/using-git/caching-your-github-credentials-in-git). If you are already using credential caching, please make sure that your computer has the correct credentials cached. Incorrect or out of date credentials will cause authentication to fail.
|
||||
**Tip**: If you don't want to enter your credentials every time you interact with the remote repository, you can turn on [credential caching](/github/getting-started-with-github/caching-your-github-credentials-in-git). If you are already using credential caching, please make sure that your computer has the correct credentials cached. Incorrect or out of date credentials will cause authentication to fail.
|
||||
|
||||
{% endtip %}
|
||||
|
||||
### Use SSH instead
|
||||
|
||||
If you've previously set up SSH keys, you can use the SSH clone URL instead of HTTPS. For more information, see "[Which remote URL should I use?](/articles/which-remote-url-should-i-use)"
|
||||
If you've previously set up SSH keys, you can use the SSH clone URL instead of HTTPS. For more information, see "[About remote repositories](/github/getting-started-with-github/about-remote-repositories)."
|
||||
|
||||
@@ -33,7 +33,7 @@ Create a personal access token on your application settings page. For more infor
|
||||
|
||||
{% data reusables.command_line.providing-token-as-password %}
|
||||
|
||||
To avoid these prompts, you can use Git password caching. For information, see "[Caching your GitHub credentials in Git](/github/using-git/caching-your-github-credentials-in-git)."
|
||||
To avoid these prompts, you can use Git password caching. For information, see "[Caching your GitHub credentials in Git](/github/getting-started-with-github/caching-your-github-credentials-in-git)."
|
||||
|
||||
{% warning %}
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ redirect_from:
|
||||
- /rebase/
|
||||
- articles/interactive-rebase/
|
||||
- /articles/about-git-rebase
|
||||
- /github/using-git/about-git-rebase
|
||||
intro: 'The `git rebase` command allows you to easily change a series of commits, modifying the history of your repository. You can reorder, edit, or squash commits together.'
|
||||
versions:
|
||||
free-pro-team: '*'
|
||||
@@ -67,7 +68,7 @@ There are six commands available while rebasing:
|
||||
|
||||
### An example of using `git rebase`
|
||||
|
||||
No matter which command you use, Git will launch [your default text editor](/articles/associating-text-editors-with-git) and open a file that details the commits in the range you've chosen. That file looks something like this:
|
||||
No matter which command you use, Git will launch [your default text editor](/github/getting-started-with-github/associating-text-editors-with-git) and open a file that details the commits in the range you've chosen. That file looks something like this:
|
||||
|
||||
```
|
||||
pick 1fc6c95 Patch A
|
||||
@@ -4,6 +4,7 @@ redirect_from:
|
||||
- /articles/working-with-subtree-merge/
|
||||
- /subtree-merge/
|
||||
- /articles/about-git-subtree-merges
|
||||
- /github/using-git/about-git-subtree-merges
|
||||
intro: 'If you need to manage multiple projects within a single repository, you can use a *subtree merge* to handle all the references.'
|
||||
versions:
|
||||
free-pro-team: '*'
|
||||
@@ -85,7 +86,7 @@ Although we've only added one subproject, any number of subprojects can be incor
|
||||
|
||||
{% tip %}
|
||||
|
||||
**Tip**: If you create a fresh clone of the repository in the future, the remotes you've added will not be created for you. You will have to add them again using [the `git remote add` command](/articles/adding-a-remote).
|
||||
**Tip**: If you create a fresh clone of the repository in the future, the remotes you've added will not be created for you. You will have to add them again using [the `git remote add` command](/github/getting-started-with-github/managing-remote-repositories).
|
||||
|
||||
{% endtip %}
|
||||
|
||||
@@ -1,18 +1,51 @@
|
||||
---
|
||||
title: Which remote URL should I use?
|
||||
title: About remote repositories
|
||||
redirect_from:
|
||||
- /articles/working-when-github-goes-down/
|
||||
- /articles/sharing-repositories-without-github/
|
||||
- /articles/about-remote-repositories
|
||||
- /articles/which-url-should-i-use/
|
||||
- /articles/which-remote-url-should-i-use
|
||||
intro: 'There are several ways to clone repositories available on {% data variables.product.product_location %}.'
|
||||
- /github/using-git/which-remote-url-should-i-use
|
||||
- /github/using-git/about-remote-repositories
|
||||
intro: 'GitHub''s collaborative approach to development depends on publishing commits from your local repository to {% data variables.product.product_name %} for other people to view, fetch, and update.'
|
||||
versions:
|
||||
free-pro-team: '*'
|
||||
enterprise-server: '*'
|
||||
github-ae: '*'
|
||||
---
|
||||
|
||||
When you view a repository while signed in to your account, the URLs you can use to clone the project onto your computer are available below the repository details:
|
||||
### About remote repositories
|
||||
|
||||
For information on setting or changing your remote URL, see "[Changing a remote's URL](/articles/changing-a-remote-s-url)."
|
||||
A remote URL is Git's fancy way of saying "the place where your code is stored." That URL could be your repository on GitHub, or another user's fork, or even on a completely different server.
|
||||
|
||||
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`
|
||||
|
||||
Git associates a remote URL with a name, and your default remote is usually called `origin`.
|
||||
|
||||
### Creating remote repositories
|
||||
|
||||
You can use the `git remote add` command to match a remote URL with a name.
|
||||
For example, you'd type the following in the command line:
|
||||
|
||||
```shell
|
||||
git remote add origin <em> <REMOTE_URL> </em>
|
||||
```
|
||||
|
||||
This associates the name `origin` with the `REMOTE_URL`.
|
||||
|
||||
You can use the command `git remote set-url` to [change a remote's URL](/github/getting-started-with-github/managing-remote-repositories).
|
||||
|
||||
### Choosing a URL for your remote repository
|
||||
|
||||
There are several ways to clone repositories available on {% data variables.product.product_location %}.
|
||||
|
||||
When you view a repository while signed in to your account, the URLs you can use to clone the project onto your computer are available below the repository details.
|
||||
|
||||
For information on setting or changing your remote URL, see "[Managing remote repositories](/github/getting-started-with-github/managing-remote-repositories)."
|
||||
|
||||
### Cloning with HTTPS URLs
|
||||
|
||||
@@ -25,9 +58,7 @@ When you `git clone`, `git fetch`, `git pull`, or `git push` to a remote reposit
|
||||
{% tip %}
|
||||
|
||||
**Tips**:
|
||||
|
||||
- You can use a credential helper so Git will remember your {% data variables.product.prodname_dotcom %} credentials every time it talks to {% data variables.product.prodname_dotcom %}. For more information, see "[Caching your {% data variables.product.prodname_dotcom %} credentials in Git](/github/using-git/caching-your-github-credentials-in-git)."
|
||||
|
||||
- You can use a credential helper so Git will remember your {% data variables.product.prodname_dotcom %} credentials every time it talks to {% data variables.product.prodname_dotcom %}. For more information, see "[Caching your {% data variables.product.prodname_dotcom %} credentials in Git](/github/getting-started-with-github/caching-your-github-credentials-in-git)."
|
||||
- To clone a repository without authenticating to {% data variables.product.product_name %} on the command line, you can use {% data variables.product.prodname_desktop %} to clone instead. For more information, see "[Cloning a repository from {% data variables.product.prodname_dotcom %} to {% data variables.product.prodname_dotcom %} Desktop](/desktop/contributing-to-projects/cloning-a-repository-from-github-to-github-desktop)."
|
||||
|
||||
{% endtip %}
|
||||
@@ -63,7 +94,3 @@ You can also use a [Subversion](https://subversion.apache.org/) client to access
|
||||
|
||||
You can also access repositories on {% data variables.product.prodname_dotcom %} from Subversion clients. For more information, see "[Support for Subversion clients](/github/importing-your-projects-to-github/support-for-subversion-clients)."
|
||||
{% endif %}
|
||||
|
||||
### Further reading
|
||||
|
||||
- [Working with Remotes](https://git-scm.com/book/en/Git-Basics-Working-with-Remotes) from the _Pro Git_ book site
|
||||
@@ -6,6 +6,7 @@ redirect_from:
|
||||
- /articles/using-textmate-as-your-default-editor/
|
||||
- /articles/using-sublime-text-2-as-your-default-editor/
|
||||
- /articles/associating-text-editors-with-git
|
||||
- /github/using-git/associating-text-editors-with-git
|
||||
versions:
|
||||
free-pro-team: '*'
|
||||
enterprise-server: '*'
|
||||
@@ -4,7 +4,8 @@ redirect_from:
|
||||
- /firewalls-and-proxies/
|
||||
- /articles/caching-your-github-password-in-git
|
||||
- /github/using-git/caching-your-github-password-in-git
|
||||
intro: 'If you''re [cloning {% data variables.product.product_name %} repositories using HTTPS](/github/using-git/which-remote-url-should-i-use), you can use a credential helper to tell Git to remember your credentials.'
|
||||
- /github/using-git/caching-your-github-credentials-in-git
|
||||
intro: 'If you''re [cloning {% data variables.product.product_name %} repositories using HTTPS](/github/getting-started-with-github/about-remote-repositories), you can use a credential helper to tell Git to remember your credentials.'
|
||||
versions:
|
||||
free-pro-team: '*'
|
||||
enterprise-server: '*'
|
||||
@@ -6,6 +6,7 @@ redirect_from:
|
||||
- /line-endings/
|
||||
- /articles/dealing-with-line-endings/
|
||||
- /articles/configuring-git-to-handle-line-endings
|
||||
- /github/using-git/configuring-git-to-handle-line-endings
|
||||
versions:
|
||||
free-pro-team: '*'
|
||||
enterprise-server: '*'
|
||||
@@ -3,6 +3,7 @@ title: Dealing with non-fast-forward errors
|
||||
intro: 'Sometimes, Git can''t make your change to a remote repository without losing commits. When this happens, your push is refused.'
|
||||
redirect_from:
|
||||
- /articles/dealing-with-non-fast-forward-errors
|
||||
- /github/using-git/dealing-with-non-fast-forward-errors
|
||||
versions:
|
||||
free-pro-team: '*'
|
||||
enterprise-server: '*'
|
||||
@@ -21,7 +22,7 @@ $ git push origin main
|
||||
> 'Note about fast-forwards' section of 'git push --help' for details.
|
||||
```
|
||||
|
||||
You can fix this by [fetching and merging](/articles/getting-changes-from-a-remote-repository) the changes made on the remote branch with the changes that you have made locally:
|
||||
You can fix this by [fetching and merging](/github/getting-started-with-github/getting-changes-from-a-remote-repository) the changes made on the remote branch with the changes that you have made locally:
|
||||
|
||||
```shell
|
||||
$ git fetch origin
|
||||
@@ -4,12 +4,13 @@ intro: You can use common Git commands to access remote repositories.
|
||||
redirect_from:
|
||||
- /articles/fetching-a-remote/
|
||||
- /articles/getting-changes-from-a-remote-repository
|
||||
- /github/using-git/getting-changes-from-a-remote-repository
|
||||
versions:
|
||||
free-pro-team: '*'
|
||||
enterprise-server: '*'
|
||||
github-ae: '*'
|
||||
---
|
||||
These commands are very useful when interacting with [a remote repository](/articles/about-remote-repositories). `clone` and `fetch` download remote code from a repository's remote URL to your local computer, `merge` is used to merge different people's work together with yours, and `pull` is a combination of `fetch` and `merge`.
|
||||
These commands are very useful when interacting with [a remote repository](/github/getting-started-with-github/about-remote-repositories). `clone` and `fetch` download remote code from a repository's remote URL to your local computer, `merge` is used to merge different people's work together with yours, and `pull` is a combination of `fetch` and `merge`.
|
||||
|
||||
### Cloning a repository
|
||||
|
||||
@@ -20,7 +21,7 @@ $ git clone https://{% data variables.command_line.codeblock %}/<em>USERNAME</em
|
||||
# Clones a repository to your computer
|
||||
```
|
||||
|
||||
You can choose from [several different URLs](/articles/which-remote-url-should-i-use) when cloning a repository. While logged in to {% data variables.product.prodname_dotcom %}, these URLs are available below the repository details:
|
||||
You can choose from [several different URLs](/github/getting-started-with-github/about-remote-repositories) when cloning a repository. While logged in to {% data variables.product.prodname_dotcom %}, these URLs are available below the repository details:
|
||||
|
||||

|
||||
|
||||
@@ -39,15 +40,14 @@ such remote-tracking branch names to `origin/foo`.
|
||||
|
||||
Use `git fetch` to retrieve new work done by other people. Fetching from a repository grabs all the new remote-tracking branches and tags *without* merging those changes into your own branches.
|
||||
|
||||
If you already have a local repository [with a remote URL](/articles/adding-a-remote) set up for the desired project, you can grab all the new information by using `git fetch *remotename*` in the terminal:
|
||||
If you already have a local repository with a remote URL set up for the desired project, you can grab all the new information by using `git fetch *remotename*` in the terminal:
|
||||
|
||||
```shell
|
||||
$ git fetch <em>remotename</em>
|
||||
# Fetches updates made to a remote repository
|
||||
```
|
||||
|
||||
Otherwise, you can always [add a new remote](/articles/adding-a-remote)
|
||||
and then fetch.
|
||||
Otherwise, you can always add a new remote and then fetch. For more information, see "[Managing remote repositories](/github/getting-started-with-github/managing-remote-repositories)."
|
||||
|
||||
### Merging changes into your local branch
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
---
|
||||
title: Getting started with Git and GitHub
|
||||
title: Getting started with Git
|
||||
intro: ''
|
||||
mapTopic: true
|
||||
redirect_from:
|
||||
- /articles/getting-started-with-git-and-github
|
||||
- /github/using-git/getting-started-with-git-and-github
|
||||
- /github/using-git/learning-about-git
|
||||
- /articles/learning-about-git
|
||||
versions:
|
||||
free-pro-team: '*'
|
||||
enterprise-server: '*'
|
||||
@@ -4,6 +4,7 @@ intro: '{% data variables.product.prodname_dotcom %} flow is a lightweight, bran
|
||||
redirect_from:
|
||||
- /articles/what-is-a-good-git-workflow/
|
||||
- /articles/git-workflows
|
||||
- /github/using-git/git-workflows
|
||||
versions:
|
||||
free-pro-team: '*'
|
||||
enterprise-server: '*'
|
||||
@@ -4,6 +4,7 @@ redirect_from:
|
||||
- /git-ignore/
|
||||
- /ignore-files/
|
||||
- /articles/ignoring-files
|
||||
- /github/using-git/ignoring-files
|
||||
intro: 'You can configure Git to ignore files you don''t want to check in to {% data variables.product.product_name %}.'
|
||||
versions:
|
||||
free-pro-team: '*'
|
||||
@@ -12,6 +12,9 @@ redirect_from:
|
||||
- /categories/53/articles/
|
||||
- /categories/setup/
|
||||
- /categories/getting-started-with-github
|
||||
- /categories/19/articles/
|
||||
- /categories/using-git
|
||||
- /github/using-git
|
||||
versions:
|
||||
free-pro-team: '*'
|
||||
enterprise-server: '*'
|
||||
@@ -68,7 +71,6 @@ topics:
|
||||
{% link_in_list /access-permissions-on-github %}
|
||||
{% link_in_list /faq-about-changes-to-githubs-plans %}
|
||||
|
||||
|
||||
{% topic_link_in_list /signing-up-for-github %}
|
||||
{% link_in_list /signing-up-for-a-new-github-account %}
|
||||
{% link_in_list /verifying-your-email-address %}
|
||||
@@ -89,4 +91,25 @@ topics:
|
||||
{% link_in_list /saving-repositories-with-stars %}
|
||||
{% link_in_list /following-people %}
|
||||
|
||||
{% topic_link_in_list /getting-started-with-git %}
|
||||
{% link_in_list /setting-your-username-in-git %}
|
||||
{% link_in_list /caching-your-github-credentials-in-git %}
|
||||
{% link_in_list /why-is-git-always-asking-for-my-password %}
|
||||
{% link_in_list /updating-credentials-from-the-macos-keychain %}
|
||||
{% link_in_list /git-workflows %}
|
||||
{% link_in_list /about-remote-repositories %}
|
||||
{% link_in_list /managing-remote-repositories %}
|
||||
{% link_in_list /associating-text-editors-with-git %}
|
||||
{% link_in_list /configuring-git-to-handle-line-endings %}
|
||||
{% link_in_list /ignoring-files %}
|
||||
|
||||
{% topic_link_in_list /using-git %}
|
||||
{% link_in_list /pushing-commits-to-a-remote-repository %}
|
||||
{% link_in_list /getting-changes-from-a-remote-repository %}
|
||||
{% link_in_list /dealing-with-non-fast-forward-errors %}
|
||||
{% link_in_list /splitting-a-subfolder-out-into-a-new-repository %}
|
||||
{% link_in_list /about-git-subtree-merges %}
|
||||
{% link_in_list /about-git-rebase %}
|
||||
{% link_in_list /using-git-rebase-on-the-command-line %}
|
||||
{% link_in_list /resolving-merge-conflicts-after-a-git-rebase %}
|
||||
</div>
|
||||
|
||||
@@ -0,0 +1,234 @@
|
||||
---
|
||||
title: Managing remote repositories
|
||||
intro: 'Learn to work with your local repositories on your computer and remote repositories hosted on {% data variables.product.product_name %}.'
|
||||
redirect_from:
|
||||
- /categories/18/articles/
|
||||
- /remotes/
|
||||
- /categories/managing-remotes/
|
||||
- /articles/managing-remote-repositories
|
||||
- /articles/adding-a-remote
|
||||
- /github/using-git/adding-a-remote
|
||||
- /articles/changing-a-remote-s-url
|
||||
- /articles/changing-a-remotes-url
|
||||
- /github/using-git/changing-a-remotes-url
|
||||
- /articles/renaming-a-remote
|
||||
- /github/using-git/renaming-a-remote
|
||||
- /articles/removing-a-remote
|
||||
- /github/using-git/removing-a-remote
|
||||
- /github/using-git/managing-remote-repositories
|
||||
versions:
|
||||
free-pro-team: '*'
|
||||
enterprise-server: '*'
|
||||
github-ae: '*'
|
||||
---
|
||||
|
||||
### Adding a remote repository
|
||||
|
||||
To add a new remote, use the `git remote add` command on the terminal, in the directory your repository is stored at.
|
||||
|
||||
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 %}/user/repo.git`
|
||||
|
||||
For example:
|
||||
|
||||
```shell
|
||||
$ git remote add origin https://{% data variables.command_line.codeblock %}/<em>user</em>/<em>repo</em>.git
|
||||
# Set a new remote
|
||||
|
||||
$ git remote -v
|
||||
# Verify new remote
|
||||
> origin https://{% data variables.command_line.codeblock %}/<em>user</em>/<em>repo</em>.git (fetch)
|
||||
> origin https://{% data variables.command_line.codeblock %}/<em>user</em>/<em>repo</em>.git (push)
|
||||
```
|
||||
|
||||
For more information on which URL to use, see "[About remote repositories](/github/getting-started-with-github/about-remote-repositories)."
|
||||
|
||||
#### Troubleshooting: Remote origin already exists
|
||||
|
||||
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
|
||||
> fatal: remote origin already exists.
|
||||
```
|
||||
|
||||
To fix this, you can:
|
||||
* Use a different name for the new remote
|
||||
* Rename the existing remote repository
|
||||
* Delete the existing remote repository
|
||||
|
||||
### Changing a remote repository's URL
|
||||
|
||||
The `git remote set-url` command changes an existing remote repository URL.
|
||||
|
||||
{% tip %}
|
||||
|
||||
**Tip:** For information on the difference between HTTPS and SSH URLs, see "[About remote repositories](/github/getting-started-with-github/about-remote-repositories)."
|
||||
|
||||
{% endtip %}
|
||||
|
||||
The `git remote set-url` command takes two arguments:
|
||||
|
||||
* An existing remote name. For example, `origin` or `upstream` are two common choices.
|
||||
* A new URL for the remote. For example:
|
||||
* If you're updating to use HTTPS, your URL might look like:
|
||||
```shell
|
||||
https://{% data variables.command_line.backticks %}/<em>USERNAME</em>/<em>REPOSITORY</em>.git
|
||||
```
|
||||
* If you're updating to use SSH, your URL might look like:
|
||||
```shell
|
||||
git@{% data variables.command_line.codeblock %}:<em>USERNAME</em>/<em>REPOSITORY</em>.git
|
||||
```
|
||||
|
||||
#### Switching remote URLs from SSH to HTTPS
|
||||
|
||||
{% 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 %}:<em>USERNAME/REPOSITORY</em>.git (fetch)
|
||||
> origin git@{% data variables.command_line.codeblock %}:<em>USERNAME/REPOSITORY</em>.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 %}/<em>USERNAME</em>/<em>REPOSITORY</em>.git
|
||||
```
|
||||
5. Verify that the remote URL has changed.
|
||||
```shell
|
||||
$ git remote -v
|
||||
# Verify new remote URL
|
||||
> origin https://{% data variables.command_line.codeblock %}/<em>USERNAME/REPOSITORY</em>.git (fetch)
|
||||
> origin https://{% data variables.command_line.codeblock %}/<em>USERNAME/REPOSITORY</em>.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 %}
|
||||
|
||||
You can [use a credential helper](/github/getting-started-with-github/caching-your-github-credentials-in-git) so Git will remember your GitHub username and personal access token every time it talks to GitHub.
|
||||
|
||||
#### Switching remote URLs from HTTPS to SSH
|
||||
|
||||
{% 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 %}/<em>USERNAME/REPOSITORY</em>.git (fetch)
|
||||
> origin https://{% data variables.command_line.codeblock %}/<em>USERNAME/REPOSITORY</em>.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 %}:<em>USERNAME</em>/<em>REPOSITORY</em>.git
|
||||
```
|
||||
5. Verify that the remote URL has changed.
|
||||
```shell
|
||||
$ git remote -v
|
||||
# Verify new remote URL
|
||||
> origin git@{% data variables.command_line.codeblock %}:<em>USERNAME/REPOSITORY</em>.git (fetch)
|
||||
> origin git@{% data variables.command_line.codeblock %}:<em>USERNAME/REPOSITORY</em>.git (push)
|
||||
```
|
||||
|
||||
#### Troubleshooting: No such remote '[name]'
|
||||
|
||||
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
|
||||
> fatal: No such remote 'sofake'
|
||||
```
|
||||
|
||||
Check that you've correctly typed the remote name.
|
||||
|
||||
### Renaming a remote repository
|
||||
|
||||
Use the `git remote rename` command to rename an existing remote.
|
||||
|
||||
The `git remote rename` command takes two arguments:
|
||||
* An existing remote name, for example, `origin`
|
||||
* A new name for the remote, for example, `destination`
|
||||
|
||||
### Example
|
||||
|
||||
These examples assume you're [cloning using HTTPS](/github/getting-started-with-github/about-remote-repositories/#cloning-with-https-urls), which is recommended.
|
||||
|
||||
```shell
|
||||
$ git remote -v
|
||||
# View existing remotes
|
||||
> origin https://{% data variables.command_line.codeblock %}/<em>OWNER</em>/<em>REPOSITORY</em>.git (fetch)
|
||||
> origin https://{% data variables.command_line.codeblock %}/<em>OWNER</em>/<em>REPOSITORY</em>.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 %}/<em>OWNER</em>/<em>REPOSITORY</em>.git (fetch)
|
||||
> destination https://{% data variables.command_line.codeblock %}/<em>OWNER</em>/<em>REPOSITORY</em>.git (push)
|
||||
```
|
||||
|
||||
#### Troubleshooting: Could not rename config section 'remote.[old name]' to 'remote.[new name]'
|
||||
|
||||
This error means that the remote you tried the old remote name you typed doesn't exist.
|
||||
|
||||
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 %}/<em>OWNER</em>/<em>REPOSITORY</em>.git (fetch)
|
||||
> origin https://{% data variables.command_line.codeblock %}/<em>OWNER</em>/<em>REPOSITORY</em>.git (push)
|
||||
```
|
||||
|
||||
#### Troubleshooting: Remote [new name] already exists
|
||||
|
||||
This error means that the remote name you want to use already exists. To solve this, either use a different remote name, or rename the original remote.
|
||||
|
||||
### Removing a remote repository
|
||||
|
||||
Use the `git remote rm` command to remove a remote URL from your repository.
|
||||
|
||||
The `git remote rm` command takes one argument:
|
||||
* A remote name, for example, `destination`
|
||||
|
||||
### Example
|
||||
|
||||
These examples assume you're [cloning using HTTPS](/github/getting-started-with-github/about-remote-repositories/#cloning-with-https-urls), which is recommended.
|
||||
|
||||
```shell
|
||||
$ git remote -v
|
||||
# View current remotes
|
||||
> origin https://{% data variables.command_line.codeblock %}/<em>OWNER/REPOSITORY</em>.git (fetch)
|
||||
> origin https://{% data variables.command_line.codeblock %}/<em>OWNER/REPOSITORY</em>.git (push)
|
||||
> destination https://{% data variables.command_line.codeblock %}/<em>FORKER/REPOSITORY</em>.git (fetch)
|
||||
> destination https://{% data variables.command_line.codeblock %}/<em>FORKER/REPOSITORY</em>.git (push)
|
||||
|
||||
$ git remote rm destination
|
||||
# Remove remote
|
||||
$ git remote -v
|
||||
# Verify it's gone
|
||||
> origin https://{% data variables.command_line.codeblock %}/<em>OWNER/REPOSITORY</em>.git (fetch)
|
||||
> origin https://{% data variables.command_line.codeblock %}/<em>OWNER/REPOSITORY</em>.git (push)
|
||||
```
|
||||
|
||||
{% warning %}
|
||||
|
||||
**Note**: `git remote rm` does not delete the remote repository from the server. It simply
|
||||
removes the remote and its references from your local repository.
|
||||
|
||||
{% endwarning %}
|
||||
|
||||
#### Troubleshooting: Could not remove config section 'remote.[name]'
|
||||
|
||||
This error means that the remote you tried to delete doesn't exist:
|
||||
|
||||
```shell
|
||||
$ git remote rm sofake
|
||||
> error: Could not remove config section 'remote.sofake'
|
||||
```
|
||||
|
||||
Check that you've correctly typed the remote name.
|
||||
|
||||
### Further reading
|
||||
|
||||
- "[Working with Remotes" from the _Pro Git_ book](https://git-scm.com/book/en/Git-Basics-Working-with-Remotes)
|
||||
@@ -4,6 +4,7 @@ intro: Use `git push` to push commits made on your local branch to a remote repo
|
||||
redirect_from:
|
||||
- /articles/pushing-to-a-remote/
|
||||
- /articles/pushing-commits-to-a-remote-repository
|
||||
- /github/using-git/pushing-commits-to-a-remote-repository
|
||||
versions:
|
||||
free-pro-team: '*'
|
||||
enterprise-server: '*'
|
||||
@@ -42,7 +43,7 @@ repository you're pushing to, you'll get a message saying `non-fast-forward upda
|
||||
This means that you must retrieve, or "fetch," the upstream changes, before
|
||||
you are able to push your local changes.
|
||||
|
||||
For more information on this error, see "[Dealing with non-fast-forward errors](/articles/dealing-with-non-fast-forward-errors)."
|
||||
For more information on this error, see "[Dealing with non-fast-forward errors](/github/getting-started-with-github/dealing-with-non-fast-forward-errors)."
|
||||
|
||||
### Pushing tags
|
||||
|
||||
@@ -110,5 +111,5 @@ For more information on working with forks, see "[Syncing a fork](/articles/sync
|
||||
- [The "Remotes" chapter from the "Pro Git" book](https://git-scm.com/book/ch5-2.html)
|
||||
- [`git remote` man page](https://git-scm.com/docs/git-remote.html)
|
||||
- "[Git cheatsheet](/articles/git-cheatsheet)"
|
||||
- "[Git workflows](/articles/git-workflows)"
|
||||
- "[Git workflows](/github/getting-started-with-github/git-workflows)"
|
||||
- "[Git Handbook](https://guides.github.com/introduction/git-handbook/)"
|
||||
@@ -3,6 +3,7 @@ title: Resolving merge conflicts after a Git rebase
|
||||
intro: 'When you perform a `git rebase` operation, you''re typically moving commits around. Because of this, you might get into a situation where a merge conflict is introduced. That means that two of your commits modified the same line in the same file, and Git doesn''t know which change to apply.'
|
||||
redirect_from:
|
||||
- /articles/resolving-merge-conflicts-after-a-git-rebase
|
||||
- /github/using-git/resolving-merge-conflicts-after-a-git-rebase
|
||||
versions:
|
||||
free-pro-team: '*'
|
||||
enterprise-server: '*'
|
||||
@@ -36,7 +36,7 @@ If you don't need to work with files locally, {% data variables.product.product_
|
||||
### Setting up Git
|
||||
|
||||
1. [Download and install the latest version of Git](https://git-scm.com/downloads).
|
||||
2. [Set your username in Git](/articles/setting-your-username-in-git).
|
||||
2. [Set your username in Git](/github/getting-started-with-github/setting-your-username-in-git).
|
||||
3. [Set your commit email address in Git](/articles/setting-your-commit-email-address).
|
||||
|
||||
### Next steps: Authenticating with {% data variables.product.prodname_dotcom %} from Git
|
||||
@@ -45,11 +45,11 @@ When you connect to a {% data variables.product.product_name %} repository from
|
||||
|
||||
#### Connecting over HTTPS (recommended)
|
||||
|
||||
If you [clone with HTTPS](/articles/which-remote-url-should-i-use/#cloning-with-https-urls), you can [cache your {% data variables.product.prodname_dotcom %} credentials in Git](/github/using-git/caching-your-github-credentials-in-git) using a credential helper.
|
||||
If you [clone with HTTPS](/github/getting-started-with-github/about-remote-repositories/#cloning-with-https-urls), you can [cache your {% data variables.product.prodname_dotcom %} credentials in Git](/github/getting-started-with-github/caching-your-github-credentials-in-git) using a credential helper.
|
||||
|
||||
#### Connecting over SSH
|
||||
|
||||
If you [clone with SSH](/articles/which-remote-url-should-i-use#cloning-with-ssh-urls), you must [generate SSH keys](/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent) on each computer you use to push or pull from {% data variables.product.product_name %}.
|
||||
If you [clone with SSH](/github/getting-started-with-github/about-remote-repositories/#cloning-with-ssh-urls), you must [generate SSH keys](/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent) on each computer you use to push or pull from {% data variables.product.product_name %}.
|
||||
|
||||
### Celebrate
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ title: Setting your username in Git
|
||||
intro: 'Git uses a username to associate commits with an identity. The Git username is not the same as your {% data variables.product.product_name %} username.'
|
||||
redirect_from:
|
||||
- /articles/setting-your-username-in-git
|
||||
- /github/using-git/setting-your-username-in-git
|
||||
versions:
|
||||
free-pro-team: '*'
|
||||
enterprise-server: '*'
|
||||
@@ -3,6 +3,7 @@ title: Splitting a subfolder out into a new repository
|
||||
redirect_from:
|
||||
- /articles/splitting-a-subpath-out-into-a-new-repository/
|
||||
- /articles/splitting-a-subfolder-out-into-a-new-repository
|
||||
- /github/using-git/splitting-a-subfolder-out-into-a-new-repository
|
||||
intro: You can turn a folder within a Git repository into a brand new repository.
|
||||
versions:
|
||||
free-pro-team: '*'
|
||||
@@ -49,7 +50,7 @@ If you create a new clone of the repository, you won't lose any of your Git hist
|
||||
|
||||
{% tip %}
|
||||
|
||||
**Tip:** For information on the difference between HTTPS and SSH URLs, see "[Which remote URL should I use?](/articles/which-remote-url-should-i-use)"
|
||||
**Tip:** For information on the difference between HTTPS and SSH URLs, see "[About remote repositories](/github/getting-started-with-github/about-remote-repositories)."
|
||||
|
||||
{% endtip %}
|
||||
|
||||
@@ -4,6 +4,7 @@ intro: 'You''ll need to update your saved credentials in the `git-credential-osx
|
||||
redirect_from:
|
||||
- /articles/updating-credentials-from-the-osx-keychain
|
||||
- /github/using-git/updating-credentials-from-the-osx-keychain
|
||||
- /github/using-git/updating-credentials-from-the-macos-keychain
|
||||
versions:
|
||||
free-pro-team: '*'
|
||||
enterprise-server: '*'
|
||||
@@ -35,4 +36,4 @@ If it's successful, nothing will print out. To test that it works, try and clone
|
||||
|
||||
### Further reading
|
||||
|
||||
- "[Caching your {% data variables.product.prodname_dotcom %} credentials in Git](/github/using-git/caching-your-github-credentials-in-git/)"
|
||||
- "[Caching your {% data variables.product.prodname_dotcom %} credentials in Git](/github/getting-started-with-github/caching-your-github-credentials-in-git/)"
|
||||
@@ -3,6 +3,7 @@ title: Using Git rebase on the command line
|
||||
redirect_from:
|
||||
- /articles/using-git-rebase/
|
||||
- /articles/using-git-rebase-on-the-command-line
|
||||
- /github/using-git/using-git-rebase-on-the-command-line
|
||||
intro: Here's a short tutorial on using `git rebase` on the command line.
|
||||
versions:
|
||||
free-pro-team: '*'
|
||||
@@ -139,4 +140,4 @@ Force pushing has serious implications because it changes the historical sequenc
|
||||
|
||||
### Further reading
|
||||
|
||||
* "[Resolving merge conflicts after a Git rebase](/articles/resolving-merge-conflicts-after-a-git-rebase)"
|
||||
* "[Resolving merge conflicts after a Git rebase](/github/getting-started-with-github/resolving-merge-conflicts-after-a-git-rebase)"
|
||||
@@ -1,8 +1,11 @@
|
||||
---
|
||||
title: Using advanced Git commands
|
||||
title: Using Git
|
||||
intro: ''
|
||||
mapTopic: true
|
||||
redirect_from:
|
||||
- /articles/using-common-git-commands
|
||||
- /github/using-git/using-common-git-commands
|
||||
- /github/using-git/using-advanced-git-commands
|
||||
- /categories/52/articles/
|
||||
- /categories/advanced-git/
|
||||
- /articles/using-advanced-git-commands
|
||||
@@ -12,4 +15,3 @@ versions:
|
||||
enterprise-server: '*'
|
||||
github-ae: '*'
|
||||
---
|
||||
|
||||
@@ -3,6 +3,7 @@ title: Why is Git always asking for my password?
|
||||
intro: 'If Git prompts you for a username and password every time you try to interact with GitHub, you''re probably using the HTTPS clone URL for your repository.'
|
||||
redirect_from:
|
||||
- /articles/why-is-git-always-asking-for-my-password
|
||||
- /github/using-git/why-is-git-always-asking-for-my-password
|
||||
versions:
|
||||
free-pro-team: '*'
|
||||
enterprise-server: '*'
|
||||
@@ -13,10 +14,10 @@ Using an HTTPS remote URL has some advantages compared with using SSH. It's easi
|
||||
|
||||
{% data reusables.user_settings.password-authentication-deprecation %}
|
||||
|
||||
You can avoid being prompted for your password by configuring Git to [cache your credentials](/github/using-git/caching-your-github-credentials-in-git) for you. Once you've configured credential caching, Git automatically uses your cached personal access token when you pull or push a repository using HTTPS.
|
||||
You can avoid being prompted for your password by configuring Git to [cache your credentials](/github/getting-started-with-github/caching-your-github-credentials-in-git) for you. Once you've configured credential caching, Git automatically uses your cached personal access token when you pull or push a repository using HTTPS.
|
||||
|
||||
### Further reading
|
||||
|
||||
* "[Which remote URL should I use](/articles/which-remote-url-should-i-use/#cloning-with-https-urls)"
|
||||
* "[About authentication to {% data variables.product.prodname_dotcom %}](/github/authenticating-to-github/about-authentication-to-github)"
|
||||
* "[Adding your SSH key to the ssh-agent](/github/authenticating-to-github/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent#adding-your-ssh-key-to-the-ssh-agent)"
|
||||
- "[About remote repositories](/github/getting-started-with-github/about-remote-repositories)."
|
||||
- "[About authentication to {% data variables.product.prodname_dotcom %}](/github/authenticating-to-github/about-authentication-to-github)"
|
||||
- "[Adding your SSH key to the ssh-agent](/github/authenticating-to-github/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent#adding-your-ssh-key-to-the-ssh-agent)"
|
||||
@@ -41,14 +41,14 @@ versions:
|
||||
```
|
||||
7. At the top of your {% data variables.product.product_name %} repository's Quick Setup page, click {% octicon "clippy" aria-label="The copy to clipboard icon" %} to copy the remote repository URL.
|
||||

|
||||
8. In Terminal, [add the URL for the remote repository](/articles/adding-a-remote) where your local repository will be pushed.
|
||||
8. In Terminal, [add the URL for the remote repository](/github/getting-started-with-github/managing-remote-repositories) where your local repository will be pushed.
|
||||
```shell
|
||||
$ git remote add origin <em> <REMOTE_URL> </em>
|
||||
# Sets the new remote
|
||||
$ git remote -v
|
||||
# Verifies the new remote URL
|
||||
```
|
||||
9. [Push the changes](/articles/pushing-commits-to-a-remote-repository/) in your local repository to {% data variables.product.product_location %}.
|
||||
9. [Push the changes](/github/getting-started-with-github/pushing-commits-to-a-remote-repository/) in your local repository to {% data variables.product.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
|
||||
@@ -78,14 +78,14 @@ versions:
|
||||
```
|
||||
7. At the top of your {% data variables.product.product_name %} repository's Quick Setup page, click {% octicon "clippy" aria-label="The copy to clipboard icon" %} to copy the remote repository URL.
|
||||

|
||||
8. In the Command prompt, [add the URL for the remote repository](/articles/adding-a-remote) where your local repository will be pushed.
|
||||
8. In the Command prompt, [add the URL for the remote repository](/github/getting-started-with-github/managing-remote-repositories) where your local repository will be pushed.
|
||||
```shell
|
||||
$ git remote add origin <em> <REMOTE_URL> </em>
|
||||
# Sets the new remote
|
||||
$ git remote -v
|
||||
# Verifies the new remote URL
|
||||
```
|
||||
9. [Push the changes](/articles/pushing-commits-to-a-remote-repository/) in your local repository to {% data variables.product.product_location %}.
|
||||
9. [Push the changes](/github/getting-started-with-github/pushing-commits-to-a-remote-repository/) in your local repository to {% data variables.product.product_location %}.
|
||||
```shell
|
||||
$ git push origin main
|
||||
# Pushes the changes in your local repository up to the remote repository you specified as the origin
|
||||
@@ -115,14 +115,14 @@ versions:
|
||||
```
|
||||
7. At the top of your {% data variables.product.product_name %} repository's Quick Setup page, click {% octicon "clippy" aria-label="The copy to clipboard icon" %} to copy the remote repository URL.
|
||||

|
||||
8. In Terminal, [add the URL for the remote repository](/articles/adding-a-remote) where your local repository will be pushed.
|
||||
8. In Terminal, [add the URL for the remote repository](/github/getting-started-with-github/managing-remote-repositories) where your local repository will be pushed.
|
||||
```shell
|
||||
$ git remote add origin <em> <REMOTE_URL> </em>
|
||||
# Sets the new remote
|
||||
$ git remote -v
|
||||
# Verifies the new remote URL
|
||||
```
|
||||
9. [Push the changes](/articles/pushing-commits-to-a-remote-repository/) in your local repository to {% data variables.product.product_location %}.
|
||||
9. [Push the changes](/github/getting-started-with-github/pushing-commits-to-a-remote-repository/) in your local repository to {% data variables.product.product_location %}.
|
||||
```shell
|
||||
$ git push origin main
|
||||
# Pushes the changes in your local repository up to the remote repository you specified as the origin
|
||||
|
||||
@@ -41,7 +41,7 @@ We recommend these tools for moving changes between Team Foundation Server and G
|
||||
|
||||
{% tip %}
|
||||
|
||||
**Tip:** After you've successfully converted your project to Git, you can [push it to {% data variables.product.prodname_dotcom %}](/articles/pushing-commits-to-a-remote-repository/).
|
||||
**Tip:** After you've successfully converted your project to Git, you can [push it to {% data variables.product.prodname_dotcom %}](/github/getting-started-with-github/pushing-commits-to-a-remote-repository/).
|
||||
|
||||
{% endtip %}
|
||||
|
||||
|
||||
@@ -51,7 +51,7 @@ For more information, see “[Git Tools Submodules](https://git-scm.com/book/en/
|
||||
|
||||
### Preserving history
|
||||
|
||||
SVN is configured to assume that the history of a project never changes. Git allows you to modify previous commits and changes using tools like [`git rebase`](/articles/about-git-rebase).
|
||||
SVN is configured to assume that the history of a project never changes. Git allows you to modify previous commits and changes using tools like [`git rebase`](/github/getting-started-with-github/about-git-rebase).
|
||||
|
||||
{% tip %}
|
||||
|
||||
|
||||
@@ -31,8 +31,6 @@ versions:
|
||||
|
||||
{% link_in_list /creating-cloning-and-archiving-repositories %}
|
||||
|
||||
{% link_in_list /using-git %}
|
||||
|
||||
{% link_in_list /committing-changes-to-your-project %}
|
||||
|
||||
{% link_in_list /collaborating-with-issues-and-pull-requests %}
|
||||
|
||||
@@ -26,7 +26,7 @@ After changing your organization's name, your old organization name becomes avai
|
||||
#### Changes that occur automatically
|
||||
|
||||
- {% data variables.product.prodname_dotcom %} automatically redirects references to your repositories. Web links to your organization's existing **repositories** will continue to work. This can take a few minutes to complete after you initiate the change.
|
||||
- You can continue pushing your local repositories to the old remote tracking URL without updating it. However, we recommend you update all existing remote repository URLs after changing your organization name. Because your old organization name is available for use by anyone else after you change it, the new organization owner can create repositories that override the redirect entries to your repository. For more information, see "[Changing a remote's URL](/articles/changing-a-remote-s-url)."
|
||||
- You can continue pushing your local repositories to the old remote tracking URL without updating it. However, we recommend you update all existing remote repository URLs after changing your organization name. Because your old organization name is available for use by anyone else after you change it, the new organization owner can create repositories that override the redirect entries to your repository. For more information, see "[Managing remote repositories](/github/getting-started-with-github/managing-remote-repositories)."
|
||||
- Previous Git commits will also be correctly attributed to users within your organization.
|
||||
|
||||
#### Changes that aren't automatic
|
||||
@@ -46,5 +46,4 @@ After changing your organization's name:
|
||||
|
||||
### Further reading
|
||||
|
||||
* "[Changing a remote's URL](/articles/changing-a-remote-s-url)"
|
||||
* "[Why are my commits linked to the wrong user?](/articles/why-are-my-commits-linked-to-the-wrong-user)"
|
||||
|
||||
@@ -32,7 +32,7 @@ After you change your username, {% data variables.product.product_name %} will a
|
||||
- Web links to your existing repositories will continue to work. This can take a few minutes to complete after you make the change.
|
||||
- Command line pushes from your local repository clones to the old remote tracking URLs will continue to work.
|
||||
|
||||
If the new owner of your old username creates a repository with the same name as your repository, that will override the redirect entry and your redirect will stop working. Because of this possibility, we recommend you update all existing remote repository URLs after changing your username. For more information, see "[Changing a remote's URL](/articles/changing-a-remote-s-url)."
|
||||
If the new owner of your old username creates a repository with the same name as your repository, that will override the redirect entry and your redirect will stop working. Because of this possibility, we recommend you update all existing remote repository URLs after changing your username. For more information, see "[Managing remote repositories](/github/getting-started-with-github/managing-remote-repositories)."
|
||||
|
||||
### Links to your previous profile page
|
||||
|
||||
@@ -58,6 +58,5 @@ After changing your username, links to your previous profile page, such as `http
|
||||
|
||||
### Further reading
|
||||
|
||||
- "[Changing a remote's URL](/articles/changing-a-remote-s-url)"
|
||||
- "[Why are my commits linked to the wrong user?](/articles/why-are-my-commits-linked-to-the-wrong-user)"{% if currentVersion == "free-pro-team@latest" %}
|
||||
- "[{% data variables.product.prodname_dotcom %} Username Policy](/articles/github-username-policy)"{% endif %}
|
||||
|
||||
@@ -18,7 +18,7 @@ topics:
|
||||
{% endtip %}
|
||||
|
||||
1. [Transfer any repositories](/articles/how-to-transfer-a-repository) from the account you want to delete to the account you want to keep. Issues, pull requests, and wikis are transferred as well. Verify the repositories exist on the account you want to keep.
|
||||
2. [Update the remote URLs](/articles/changing-a-remote-s-url) in any local clones of the repositories that were moved.
|
||||
2. [Update the remote URLs](/github/getting-started-with-github/managing-remote-repositories) in any local clones of the repositories that were moved.
|
||||
3. [Delete the account](/articles/deleting-your-user-account) you no longer want to use.
|
||||
|
||||
### Further reading
|
||||
|
||||
@@ -36,7 +36,7 @@ topics:
|
||||
|
||||
### Finding your username in your `user.name` configuration
|
||||
|
||||
During set up, you may have [set your username in Git](/articles/setting-your-username-in-git). If so, you can review the value of this configuration setting:
|
||||
During set up, you may have [set your username in Git](/github/getting-started-with-github/setting-your-username-in-git). If so, you can review the value of this configuration setting:
|
||||
|
||||
```shell
|
||||
$ git config user.name
|
||||
|
||||
@@ -1,38 +0,0 @@
|
||||
---
|
||||
title: About remote repositories
|
||||
redirect_from:
|
||||
- /articles/working-when-github-goes-down/
|
||||
- /articles/sharing-repositories-without-github/
|
||||
- /articles/about-remote-repositories
|
||||
intro: 'GitHub''s collaborative approach to development depends on publishing commits from your local repository for other people to view, fetch, and update.'
|
||||
versions:
|
||||
free-pro-team: '*'
|
||||
enterprise-server: '*'
|
||||
github-ae: '*'
|
||||
---
|
||||
|
||||
A remote URL is Git's fancy way of saying "the place where your code is stored."
|
||||
That URL could be your repository on GitHub, or another user's fork, or even on
|
||||
a completely different server.
|
||||
|
||||
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`
|
||||
|
||||
Git associates a remote URL with a name, and your default remote is usually called `origin`.
|
||||
|
||||
For information on the differences between these URLs, see "[Which remote URL should I use?](/articles/which-remote-url-should-i-use)"
|
||||
|
||||
### Creating remotes
|
||||
|
||||
You can use the `git remote add` command to match a remote URL with a name.
|
||||
For example, you'd type the following in the command line:
|
||||
|
||||
```shell
|
||||
git remote add origin <em> <REMOTE_URL> </em>
|
||||
```
|
||||
|
||||
This associates the name `origin` with the `REMOTE_URL`.
|
||||
|
||||
You can use the command `git remote set-url` to [change a remote's URL](/articles/changing-a-remote-s-url).
|
||||
@@ -1,52 +0,0 @@
|
||||
---
|
||||
title: Adding a remote
|
||||
intro: 'To add a new remote, use the `git remote add` command on the terminal, in the directory your repository is stored at.'
|
||||
redirect_from:
|
||||
- /articles/adding-a-remote
|
||||
versions:
|
||||
free-pro-team: '*'
|
||||
enterprise-server: '*'
|
||||
github-ae: '*'
|
||||
---
|
||||
|
||||
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 %}/user/repo.git`
|
||||
|
||||
For example:
|
||||
|
||||
```shell
|
||||
$ git remote add origin https://{% data variables.command_line.codeblock %}/<em>user</em>/<em>repo</em>.git
|
||||
# Set a new remote
|
||||
|
||||
$ git remote -v
|
||||
# Verify new remote
|
||||
> origin https://{% data variables.command_line.codeblock %}/<em>user</em>/<em>repo</em>.git (fetch)
|
||||
> origin https://{% data variables.command_line.codeblock %}/<em>user</em>/<em>repo</em>.git (push)
|
||||
```
|
||||
|
||||
Not sure which URL to use? Check out "[Which remote URL should I use?](/articles/which-remote-url-should-i-use)"
|
||||
|
||||
### Troubleshooting
|
||||
|
||||
You may encounter these errors when trying to add a remote.
|
||||
|
||||
#### Remote `name` already exists
|
||||
|
||||
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
|
||||
> fatal: remote origin already exists.
|
||||
```
|
||||
|
||||
To fix this, you can
|
||||
|
||||
* Use a different name for the new remote
|
||||
* [Rename the existing remote](/articles/renaming-a-remote)
|
||||
* [Delete the existing remote](/articles/removing-a-remote)
|
||||
|
||||
### Further reading
|
||||
|
||||
- "[Working with Remotes" from the _Pro Git_ book](https://git-scm.com/book/en/Git-Basics-Working-with-Remotes)
|
||||
@@ -1,97 +0,0 @@
|
||||
---
|
||||
title: Changing a remote's URL
|
||||
redirect_from:
|
||||
- /articles/changing-a-remote-s-url
|
||||
- /articles/changing-a-remotes-url
|
||||
intro: The `git remote set-url` command changes an existing remote repository URL.
|
||||
versions:
|
||||
free-pro-team: '*'
|
||||
enterprise-server: '*'
|
||||
github-ae: '*'
|
||||
---
|
||||
|
||||
{% tip %}
|
||||
|
||||
**Tip:** For information on the difference between HTTPS and SSH URLs, see "[Which remote URL should I use?](/articles/which-remote-url-should-i-use)"
|
||||
|
||||
{% endtip %}
|
||||
|
||||
The `git remote set-url` command takes two arguments:
|
||||
|
||||
* An existing remote name. For example, `origin` or `upstream` are two common choices.
|
||||
* A new URL for the remote. For example:
|
||||
* If you're updating to use HTTPS, your URL might look like:
|
||||
```shell
|
||||
https://{% data variables.command_line.backticks %}/<em>USERNAME</em>/<em>REPOSITORY</em>.git
|
||||
```
|
||||
* If you're updating to use SSH, your URL might look like:
|
||||
```shell
|
||||
git@{% data variables.command_line.codeblock %}:<em>USERNAME</em>/<em>REPOSITORY</em>.git
|
||||
```
|
||||
|
||||
### Switching remote URLs from SSH to HTTPS
|
||||
|
||||
{% 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 %}:<em>USERNAME/REPOSITORY</em>.git (fetch)
|
||||
> origin git@{% data variables.command_line.codeblock %}:<em>USERNAME/REPOSITORY</em>.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 %}/<em>USERNAME</em>/<em>REPOSITORY</em>.git
|
||||
```
|
||||
5. Verify that the remote URL has changed.
|
||||
```shell
|
||||
$ git remote -v
|
||||
# Verify new remote URL
|
||||
> origin https://{% data variables.command_line.codeblock %}/<em>USERNAME/REPOSITORY</em>.git (fetch)
|
||||
> origin https://{% data variables.command_line.codeblock %}/<em>USERNAME/REPOSITORY</em>.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 %}
|
||||
|
||||
You can [use a credential helper](/github/using-git/caching-your-github-credentials-in-git) so Git will remember your GitHub username and personal access token every time it talks to GitHub.
|
||||
|
||||
### Switching remote URLs from HTTPS to SSH
|
||||
|
||||
{% 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 %}/<em>USERNAME/REPOSITORY</em>.git (fetch)
|
||||
> origin https://{% data variables.command_line.codeblock %}/<em>USERNAME/REPOSITORY</em>.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 %}:<em>USERNAME</em>/<em>REPOSITORY</em>.git
|
||||
```
|
||||
5. Verify that the remote URL has changed.
|
||||
```shell
|
||||
$ git remote -v
|
||||
# Verify new remote URL
|
||||
> origin git@{% data variables.command_line.codeblock %}:<em>USERNAME/REPOSITORY</em>.git (fetch)
|
||||
> origin git@{% data variables.command_line.codeblock %}:<em>USERNAME/REPOSITORY</em>.git (push)
|
||||
```
|
||||
|
||||
### Troubleshooting
|
||||
|
||||
You may encounter these errors when trying to change a remote.
|
||||
|
||||
#### No such remote '[name]'
|
||||
|
||||
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
|
||||
> fatal: No such remote 'sofake'
|
||||
```
|
||||
|
||||
Check that you've correctly typed the remote name.
|
||||
|
||||
### Further reading
|
||||
|
||||
- ["Working with Remotes" from the _Pro Git_ book](https://git-scm.com/book/en/Git-Basics-Working-with-Remotes)
|
||||
@@ -1,42 +0,0 @@
|
||||
---
|
||||
title: Using Git
|
||||
intro: 'Learn common and advanced workflows in Git to enhance your experience using {% data variables.product.prodname_dotcom %}.'
|
||||
redirect_from:
|
||||
- /categories/19/articles/
|
||||
- /categories/using-git
|
||||
versions:
|
||||
free-pro-team: '*'
|
||||
enterprise-server: '*'
|
||||
github-ae: '*'
|
||||
---
|
||||
|
||||
|
||||
### Table of Contents
|
||||
|
||||
{% topic_link_in_list /getting-started-with-git-and-github %}
|
||||
{% link_in_list /setting-your-username-in-git %}
|
||||
{% link_in_list /caching-your-github-credentials-in-git %}
|
||||
{% link_in_list /why-is-git-always-asking-for-my-password %}
|
||||
{% link_in_list /updating-credentials-from-the-macos-keychain %}
|
||||
{% topic_link_in_list /learning-about-git %}
|
||||
{% link_in_list /git-workflows %}
|
||||
{% link_in_list /associating-text-editors-with-git %}
|
||||
{% link_in_list /configuring-git-to-handle-line-endings %}
|
||||
{% link_in_list /ignoring-files %}
|
||||
{% topic_link_in_list /using-common-git-commands %}
|
||||
{% link_in_list /pushing-commits-to-a-remote-repository %}
|
||||
{% link_in_list /getting-changes-from-a-remote-repository %}
|
||||
{% link_in_list /dealing-with-non-fast-forward-errors %}
|
||||
{% topic_link_in_list /managing-remote-repositories %}
|
||||
{% link_in_list /about-remote-repositories %}
|
||||
{% link_in_list /which-remote-url-should-i-use %}
|
||||
{% link_in_list /adding-a-remote %}
|
||||
{% link_in_list /changing-a-remotes-url %}
|
||||
{% link_in_list /renaming-a-remote %}
|
||||
{% link_in_list /removing-a-remote %}
|
||||
{% topic_link_in_list /using-advanced-git-commands %}
|
||||
{% link_in_list /about-git-rebase %}
|
||||
{% link_in_list /using-git-rebase-on-the-command-line %}
|
||||
{% link_in_list /resolving-merge-conflicts-after-a-git-rebase %}
|
||||
{% link_in_list /about-git-subtree-merges %}
|
||||
{% link_in_list /splitting-a-subfolder-out-into-a-new-repository %}
|
||||
@@ -1,12 +0,0 @@
|
||||
---
|
||||
title: Learning about Git
|
||||
intro: ''
|
||||
mapTopic: true
|
||||
redirect_from:
|
||||
- /articles/learning-about-git
|
||||
versions:
|
||||
free-pro-team: '*'
|
||||
enterprise-server: '*'
|
||||
github-ae: '*'
|
||||
---
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
---
|
||||
title: Managing remote repositories
|
||||
intro: 'Learn to work with your local repositories on your computer and remote repositories hosted on {% data variables.product.product_name %}.'
|
||||
mapTopic: true
|
||||
redirect_from:
|
||||
- /categories/18/articles/
|
||||
- /remotes/
|
||||
- /categories/managing-remotes/
|
||||
- /articles/managing-remote-repositories
|
||||
versions:
|
||||
free-pro-team: '*'
|
||||
enterprise-server: '*'
|
||||
github-ae: '*'
|
||||
---
|
||||
|
||||
@@ -1,60 +0,0 @@
|
||||
---
|
||||
title: Removing a remote
|
||||
intro: Use the `git remote rm` command to remove a remote URL from your repository.
|
||||
redirect_from:
|
||||
- /articles/removing-a-remote
|
||||
versions:
|
||||
free-pro-team: '*'
|
||||
enterprise-server: '*'
|
||||
github-ae: '*'
|
||||
---
|
||||
|
||||
The `git remote rm` command takes one argument:
|
||||
|
||||
* A remote name, for example, `destination`
|
||||
|
||||
### Example
|
||||
|
||||
These examples assume you're [cloning using HTTPS](/articles/which-remote-url-should-i-use/#cloning-with-https-urls), which is recommended.
|
||||
|
||||
```shell
|
||||
$ git remote -v
|
||||
# View current remotes
|
||||
> origin https://{% data variables.command_line.codeblock %}/<em>OWNER/REPOSITORY</em>.git (fetch)
|
||||
> origin https://{% data variables.command_line.codeblock %}/<em>OWNER/REPOSITORY</em>.git (push)
|
||||
> destination https://{% data variables.command_line.codeblock %}/<em>FORKER/REPOSITORY</em>.git (fetch)
|
||||
> destination https://{% data variables.command_line.codeblock %}/<em>FORKER/REPOSITORY</em>.git (push)
|
||||
|
||||
$ git remote rm destination
|
||||
# Remove remote
|
||||
$ git remote -v
|
||||
# Verify it's gone
|
||||
> origin https://{% data variables.command_line.codeblock %}/<em>OWNER/REPOSITORY</em>.git (fetch)
|
||||
> origin https://{% data variables.command_line.codeblock %}/<em>OWNER/REPOSITORY</em>.git (push)
|
||||
```
|
||||
|
||||
{% warning %}
|
||||
|
||||
**Note**: `git remote rm` does not delete the remote repository from the server. It simply
|
||||
removes the remote and its references from your local repository.
|
||||
|
||||
{% endwarning %}
|
||||
|
||||
### Troubleshooting
|
||||
|
||||
You may encounter these errors when trying to remove a remote.
|
||||
|
||||
#### Could not remove config section 'remote.[name]'
|
||||
|
||||
This error means that the remote you tried to delete doesn't exist:
|
||||
|
||||
```shell
|
||||
$ git remote rm sofake
|
||||
> error: Could not remove config section 'remote.sofake'
|
||||
```
|
||||
|
||||
Check that you've correctly typed the remote name.
|
||||
|
||||
### Further reading
|
||||
|
||||
- ["Working with Remotes" from the _Pro Git_ book](https://git-scm.com/book/en/Git-Basics-Working-with-Remotes)
|
||||
@@ -1,60 +0,0 @@
|
||||
---
|
||||
title: Renaming a remote
|
||||
intro: Use the `git remote rename` command to rename an existing remote.
|
||||
redirect_from:
|
||||
- /articles/renaming-a-remote
|
||||
versions:
|
||||
free-pro-team: '*'
|
||||
enterprise-server: '*'
|
||||
github-ae: '*'
|
||||
---
|
||||
|
||||
The `git remote rename` command takes two arguments:
|
||||
|
||||
* An existing remote name, for example, `origin`
|
||||
* A new name for the remote, for example, `destination`
|
||||
|
||||
### Example
|
||||
|
||||
These examples assume you're [cloning using HTTPS](/articles/which-remote-url-should-i-use/#cloning-with-https-urls), which is recommended.
|
||||
|
||||
```shell
|
||||
$ git remote -v
|
||||
# View existing remotes
|
||||
> origin https://{% data variables.command_line.codeblock %}/<em>OWNER</em>/<em>REPOSITORY</em>.git (fetch)
|
||||
> origin https://{% data variables.command_line.codeblock %}/<em>OWNER</em>/<em>REPOSITORY</em>.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 %}/<em>OWNER</em>/<em>REPOSITORY</em>.git (fetch)
|
||||
> destination https://{% data variables.command_line.codeblock %}/<em>OWNER</em>/<em>REPOSITORY</em>.git (push)
|
||||
```
|
||||
|
||||
### Troubleshooting
|
||||
|
||||
You may encounter these errors when trying to rename a remote.
|
||||
|
||||
#### Could not rename config section 'remote.[old name]' to 'remote.[new name]'
|
||||
|
||||
This error means that the remote you tried the old remote name you typed doesn't exist.
|
||||
|
||||
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 %}/<em>OWNER</em>/<em>REPOSITORY</em>.git (fetch)
|
||||
> origin https://{% data variables.command_line.codeblock %}/<em>OWNER</em>/<em>REPOSITORY</em>.git (push)
|
||||
```
|
||||
|
||||
#### Remote [new name] already exists.
|
||||
|
||||
This error means that the remote name you want to use already exists. To solve this,
|
||||
either use a different remote name, or rename the original remote.
|
||||
|
||||
### Further reading
|
||||
|
||||
- ["Working with Remotes" from the _Pro Git_ book](https://git-scm.com/book/en/Git-Basics-Working-with-Remotes)
|
||||
@@ -1,12 +0,0 @@
|
||||
---
|
||||
title: Using common Git commands
|
||||
intro: ''
|
||||
mapTopic: true
|
||||
redirect_from:
|
||||
- /articles/using-common-git-commands
|
||||
versions:
|
||||
free-pro-team: '*'
|
||||
enterprise-server: '*'
|
||||
github-ae: '*'
|
||||
---
|
||||
|
||||
@@ -10,7 +10,7 @@ featuredLinks:
|
||||
- /github/collaborating-with-issues-and-pull-requests/about-pull-requests
|
||||
- /github/authenticating-to-github
|
||||
- /github/importing-your-projects-to-github/adding-an-existing-project-to-github-using-the-command-line
|
||||
- /github/using-git/managing-remote-repositories
|
||||
- /github/getting-started-with-github/managing-remote-repositories
|
||||
- /github/working-with-github-pages
|
||||
versions: '*'
|
||||
---
|
||||
|
||||
@@ -10,7 +10,7 @@ topics:
|
||||
- api
|
||||
---
|
||||
|
||||
When you create a new {% data variables.product.product_name %} repository via the API, you can specify a [.gitignore template](/github/using-git/ignoring-files) to apply to the repository upon creation. The .gitignore templates API lists and fetches templates from the {% data variables.product.product_name %} [.gitignore repository](https://github.com/github/gitignore).
|
||||
When you create a new {% data variables.product.product_name %} repository via the API, you can specify a [.gitignore template](/github/getting-started-with-github/ignoring-files) to apply to the repository upon creation. The .gitignore templates API lists and fetches templates from the {% data variables.product.product_name %} [.gitignore repository](https://github.com/github/gitignore).
|
||||
|
||||
### Custom media types for gitignore
|
||||
|
||||
|
||||
@@ -155,7 +155,7 @@ You can communicate that a transient environment no longer exists by setting its
|
||||
{% if operation.subcategory == 'deployments' %}{% include rest_operation %}{% endif %}
|
||||
{% endfor %}
|
||||
|
||||
{% if currentVersion == "free-pro-team@latest" or currentVersion ver_gt "enterprise-server@3.0" or currentVersion == "github-ae@latest" %}
|
||||
{% if currentVersion == "free-pro-team@latest" or currentVersion ver_gt "enterprise-server@3.1" or currentVersion == "github-ae@next" %}
|
||||
## Environments
|
||||
|
||||
The Environments API allows you to create, configure, and delete environments. For more information about environments, see "[Environments](/actions/reference/environments)."
|
||||
|
||||
@@ -13,6 +13,7 @@ These guidelines are specific to GitHub’s documentation. For general style que
|
||||
- [Commands](#commands)
|
||||
- [Examples](#examples)
|
||||
- [Indentation](#indentation)
|
||||
- [Scheduled workflows](#scheduled-workflows)
|
||||
- [Headers](#headers)
|
||||
- [Images](#images)
|
||||
- [Alt text](#alt-text)
|
||||
@@ -145,6 +146,14 @@ In YAML examples, such as actions and workflow files, use two spaces to indent l
|
||||
python-version: ${{ matrix.python }}
|
||||
```
|
||||
|
||||
### Scheduled workflows
|
||||
|
||||
Workflow runs are delayed when too many workflows run at once. Since many users copy code from the GitHub docs, we should use examples that guide users away from congested times.
|
||||
|
||||
- Do not use examples that run on the hour. (The Actions team reports that times at the start of the hour, especially UTC midnight, are disproportionately overloaded.)
|
||||
- Do not use examples that run more frequently than necessary. For example, instead of running every 5 minutes, consider if the example makes sense to run every 30 minutes instead.
|
||||
- Use a different time for each example.
|
||||
|
||||
## Headers
|
||||
|
||||
Use H3 for headers, and H4 for subheaders. When referring to headers, surround the header name with quotation marks.
|
||||
|
||||
@@ -34258,6 +34258,11 @@ type SponsorsTier implements Node {
|
||||
descriptionHTML: HTML!
|
||||
id: ID!
|
||||
|
||||
"""
|
||||
Whether this tier is only for use with one-time sponsorships.
|
||||
"""
|
||||
isOneTime: Boolean!
|
||||
|
||||
"""
|
||||
How much this tier costs per month in cents.
|
||||
"""
|
||||
|
||||
@@ -1 +1 @@
|
||||
Encrypted secrets allow you to store sensitive information, such as access tokens, in your repository{% if currentVersion == "free-pro-team@latest" or currentVersion ver_gt "enterprise-server@3.0" or currentVersion == "github-ae@latest" %}, repository environments,{% endif %} or organization.
|
||||
Encrypted secrets allow you to store sensitive information, such as access tokens, in your repository{% if currentVersion == "free-pro-team@latest" or currentVersion ver_gt "enterprise-server@3.1" or currentVersion == "github-ae@next" %}, repository environments,{% endif %} or organization.
|
||||
|
||||
@@ -1 +1 @@
|
||||
If you're new to YAML and want to learn more, see "[Learn YAML in five minutes](https://www.codeproject.com/Articles/1214409/Learn-YAML-in-five-minutes)."
|
||||
If you're new to YAML and want to learn more, see "[Learn YAML in Y minutes](https://learnxinyminutes.com/docs/yaml/)."
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
1. [Push the changes](/articles/pushing-commits-to-a-remote-repository/) in your local repository to {% data variables.product.product_location %}.
|
||||
1. [Push the changes](/github/getting-started-with-github/pushing-commits-to-a-remote-repository/) in your local repository to {% data variables.product.product_location %}.
|
||||
```shell
|
||||
$ git push origin <em>your-branch</em>
|
||||
# Pushes the changes in your local repository up to the remote repository you specified as the origin
|
||||
|
||||
@@ -2,7 +2,12 @@
|
||||
<div class="f5 contribution">
|
||||
<h2 class="f4">{% data ui.contribution_cta.title %}</h2>
|
||||
<p class="text-gray f6">{% data ui.contribution_cta.body %}</p>
|
||||
<a class="btn btn-outline" href={{ "https://github.com/github/docs/edit/main/content/" | append: page.relativePath }}>
|
||||
{% if page.relativePath %}
|
||||
{% assign contribution_href = "https://github.com/github/docs/edit/main/content/" | append: page.relativePath %}
|
||||
{% else %}
|
||||
{% assign contribution_href = "https://github.com/github/docs" %}
|
||||
{% endif %}
|
||||
<a class="btn btn-outline" href="{{ contribution_href }}">
|
||||
{% octicon "git-pull-request" height="16" %}
|
||||
{% data ui.contribution_cta.button %}
|
||||
</a>
|
||||
|
||||
@@ -6,6 +6,9 @@
|
||||
{% include sidebar %}
|
||||
|
||||
<main class="width-full">
|
||||
{% include header %}
|
||||
{% include deprecation-banner %}
|
||||
|
||||
<main class="container-xl px-3 px-md-6 my-4 my-lg-4 d-xl-flex">
|
||||
<article class="markdown-body width-full">
|
||||
<div class="d-lg-flex flex-justify-between"></div>
|
||||
@@ -52,8 +55,9 @@
|
||||
{% for version in enterpriseServerReleases.deprecatedReleasesOnDeveloperSite %}
|
||||
<li><a href="https://developer.github.com/enterprise/{{version}}">Enterprise Server {{version}}</a></li>
|
||||
{% endfor %}
|
||||
{% include support %}
|
||||
{% include support-section %}
|
||||
{% include small-footer %}
|
||||
{% include scroll-button %}
|
||||
</div>
|
||||
</div>
|
||||
</article>
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
<!doctype html>
|
||||
{% assign error = '404' %}
|
||||
<html lang="{{currentLanguage}}">
|
||||
{% include head %}
|
||||
@@ -31,8 +32,9 @@
|
||||
</div>
|
||||
|
||||
<!-- {{ content }} -->
|
||||
{% include support %}
|
||||
{% include support-section %}
|
||||
{% include small-footer %}
|
||||
{% include scroll-button %}
|
||||
</main>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
<!doctype html>
|
||||
<html lang="{{currentLanguage}}">
|
||||
{% include head %}
|
||||
<body>
|
||||
@@ -21,7 +22,8 @@
|
||||
</div>
|
||||
|
||||
<!-- {{ content }} -->
|
||||
{% include support %}
|
||||
{% include support-section %}
|
||||
{% include small-footer %}
|
||||
{% include scroll-button %}
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
|
||||
<main class="width-full">
|
||||
{% include header %}
|
||||
{% include deprecation-banner %}
|
||||
|
||||
<main class="container-xl px-3 px-md-6 my-4 my-lg-4 d-xl-flex">
|
||||
<article class="markdown-body width-full">
|
||||
@@ -32,8 +33,9 @@
|
||||
</article>
|
||||
</main>
|
||||
|
||||
{% include support %}
|
||||
{% include support-section %}
|
||||
{% include small-footer %}
|
||||
{% include scroll-button %}
|
||||
</main>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
|
||||
<main class="width-full">
|
||||
{% include header %}
|
||||
{% include deprecation-banner %}
|
||||
|
||||
<div class="container-xl px-3 px-md-6 pt-3 pb-2">
|
||||
<header class="d-lg-flex gutter-lg mb-6">
|
||||
@@ -142,9 +143,9 @@
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<div class="border-top">
|
||||
{% include small-footer %}
|
||||
</div>
|
||||
{% include support-section %}
|
||||
{% include small-footer %}
|
||||
{% include scroll-button %}
|
||||
</main>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
|
||||
<main class="width-full overflow-auto">
|
||||
{% include header %}
|
||||
{% include deprecation-banner %}
|
||||
|
||||
<div class="bg-gray">
|
||||
<div class="container-xl px-3 px-md-6 pt-3 pb-2">
|
||||
@@ -108,9 +109,9 @@
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<div class="border-top">
|
||||
{% include small-footer %}
|
||||
</div>
|
||||
{% include support-section %}
|
||||
{% include small-footer %}
|
||||
{% include scroll-button %}
|
||||
</main>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -162,9 +162,9 @@
|
||||
</aside>
|
||||
</div>
|
||||
|
||||
<div class="border-top">
|
||||
{% include small-footer %}
|
||||
</div>
|
||||
{% include support-section %}
|
||||
{% include small-footer %}
|
||||
{% include scroll-button %}
|
||||
</main>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -1,4 +1,17 @@
|
||||
[
|
||||
{
|
||||
"schemaChanges": [
|
||||
{
|
||||
"title": "The GraphQL schema includes these changes:",
|
||||
"changes": [
|
||||
"Field `isOneTime` was added to object type `SponsorsTier`"
|
||||
]
|
||||
}
|
||||
],
|
||||
"previewChanges": [],
|
||||
"upcomingChanges": [],
|
||||
"date": "2021-03-25"
|
||||
},
|
||||
{
|
||||
"schemaChanges": [
|
||||
{
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -48261,6 +48261,14 @@
|
||||
"kind": "scalars",
|
||||
"href": "/graphql/reference/scalars#html"
|
||||
},
|
||||
{
|
||||
"name": "isOneTime",
|
||||
"description": "<p>Whether this tier is only for use with one-time sponsorships.</p>",
|
||||
"type": "Boolean!",
|
||||
"id": "boolean",
|
||||
"kind": "scalars",
|
||||
"href": "/graphql/reference/scalars#boolean"
|
||||
},
|
||||
{
|
||||
"name": "monthlyPriceInCents",
|
||||
"description": "<p>How much this tier costs per month in cents.</p>",
|
||||
|
||||
79
lib/redis/create-client.js
Normal file
79
lib/redis/create-client.js
Normal file
@@ -0,0 +1,79 @@
|
||||
const Redis = require('redis')
|
||||
|
||||
const { REDIS_MIN_DB, REDIS_MAX_DB } = process.env
|
||||
|
||||
// By default, every Redis instance supports database numbers 0 - 15
|
||||
const redisMinDb = REDIS_MIN_DB || 0
|
||||
const redisMaxDb = REDIS_MAX_DB || 15
|
||||
|
||||
function formatRedisError (error = {}) {
|
||||
const { code } = error
|
||||
const preamble = error.constructor.name + (code ? ` with code "${code}"` : '')
|
||||
return preamble + error.toString()
|
||||
}
|
||||
|
||||
module.exports = function createClient (options = {}) {
|
||||
const { db, name, url } = options
|
||||
|
||||
// If no Redis URL is provided, bail out
|
||||
// NOTE: Could support other options like `host`, `port`, and `path` but
|
||||
// choosing not to for the time being!
|
||||
if (!url) return null
|
||||
|
||||
// Verify database number is within range
|
||||
if (db != null) {
|
||||
if (!Number.isInteger(db) || db < redisMinDb || db > redisMaxDb) {
|
||||
throw new TypeError(
|
||||
`Redis database number must be an integer between ${redisMinDb} and ${redisMaxDb} but was: ${JSON.stringify(db)}`
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
// Create the client
|
||||
const client = Redis.createClient(url, {
|
||||
// Only add this configuration for TLS-enabled Redis URL values.
|
||||
// Otherwise, it breaks for local Redis instances without TLS enabled.
|
||||
...url.startsWith('rediss://') && {
|
||||
tls: {
|
||||
// Required for production Heroku Redis
|
||||
rejectUnauthorized: false
|
||||
}
|
||||
},
|
||||
|
||||
// Expand whatever other options and overrides were provided
|
||||
...options
|
||||
})
|
||||
|
||||
// If a `name` was provided, use it in the prefix for logging event messages
|
||||
const logPrefix = '[redis' + (name ? ` (${name})` : '') + '] '
|
||||
|
||||
// Add event listeners for basic logging
|
||||
client.on('connect', () => { console.log(logPrefix, 'Connection opened') })
|
||||
client.on('ready', () => { console.log(logPrefix, 'Ready to receive commands') })
|
||||
client.on(
|
||||
'reconnecting',
|
||||
({
|
||||
attempt,
|
||||
delay,
|
||||
// The rest are unofficial properties but currently supported
|
||||
error,
|
||||
total_retry_time: totalRetryTime,
|
||||
times_connected: timesConnected
|
||||
}) => {
|
||||
console.log(
|
||||
logPrefix,
|
||||
'Reconnecting,',
|
||||
`attempt ${attempt}`,
|
||||
`with ${delay} delay`,
|
||||
`due to ${formatRedisError(error)}.`,
|
||||
`Elapsed time: ${totalRetryTime}.`,
|
||||
`Successful connections: ${timesConnected}.`
|
||||
)
|
||||
}
|
||||
)
|
||||
client.on('end', () => { console.log(logPrefix, 'Connection closed') })
|
||||
client.on('warning', (msg) => { console.warn(logPrefix, 'Warning:', msg) })
|
||||
client.on('error', (error) => { console.error(logPrefix, formatRedisError(error)) })
|
||||
|
||||
return client
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user