1
0
mirror of synced 2025-12-21 02:46:50 -05:00

ran script/content-migrations/remove-map-topics.js && script/content-migrations/update-tocs.js

This commit is contained in:
Sarah Schneider
2021-05-19 10:12:38 -04:00
parent 253c356fb0
commit f7e848e0c4
14528 changed files with 410545 additions and 411354 deletions

View File

@@ -0,0 +1,28 @@
---
title: About GitHub Importer
intro: 'If you have source code in Subversion, Mercurial, Team Foundation Version Control (TFVC), or another Git repository, you can move it to GitHub using GitHub Importer.'
redirect_from:
- /articles/about-github-importer
- /github/importing-your-projects-to-github/about-github-importer
versions:
free-pro-team: '*'
---
GitHub Importer is a tool that quickly imports source code repositories, including commits and revision history, to GitHub for you.
![Importing a repository gif](/assets/images/help/importer/github-importer.gif)
During an import, depending on the version control system you're importing from, you can authenticate with your remote repository, update commit author attribution, and import repositories with large files (or remove large files if you don't want to use Git Large File Storage).
| Import action | Subversion | Mercurial | TFVC | Git |
|:--------------|:----------:|:---------:|:----------------------:|:---:|
| Authenticate with remote repository | **X** | **X** | **X** | **X** |
| [Update commit author attribution](/articles/updating-commit-author-attribution-with-github-importer) | **X** | **X** | **X** | |
| Move large files to [Git Large File Storage](/articles/about-git-large-file-storage) | **X** | **X** | **X** | |
| Remove large files from your repository | **X** | **X** | **X** | |
### Further reading
- "[Importing a repository with GitHub Importer](/articles/importing-a-repository-with-github-importer)"
- "[Updating commit author attribution with GitHub Importer](/articles/updating-commit-author-attribution-with-github-importer)"
- "[Importing a Git repository using the command line](/articles/importing-a-git-repository-using-the-command-line)"
- "[Source code migration tools](/articles/source-code-migration-tools)"

View File

@@ -0,0 +1,136 @@
---
title: Adding an existing project to GitHub using the command line
intro: 'Putting your existing work on {% data variables.product.product_name %} can let you share and collaborate in lots of great ways.'
redirect_from:
- /articles/add-an-existing-project-to-github/
- /articles/adding-an-existing-project-to-github-using-the-command-line
- /github/importing-your-projects-to-github/adding-an-existing-project-to-github-using-the-command-line
versions:
free-pro-team: '*'
enterprise-server: '*'
github-ae: '*'
---
{% data reusables.repositories.migrating-from-codeplex %}
{% tip %}
**Tip:** If you're most comfortable with a point-and-click user interface, try adding your project with {% data variables.product.prodname_desktop %}. For more information, see "[Adding a repository from your local computer to GitHub Desktop](/desktop/guides/contributing-to-projects/adding-a-repository-from-your-local-computer-to-github-desktop)" in the *{% data variables.product.prodname_desktop %} Help*.
{% endtip %}
{% data reusables.repositories.sensitive-info-warning %}
{% mac %}
1. [Create a new repository](/articles/creating-a-new-repository) on {% data variables.product.product_location %}. To avoid errors, do not initialize the new repository with *README*, license, or `gitignore` files. You can add these files after your project has been pushed to {% data variables.product.product_name %}.
![Create New Repository drop-down](/assets/images/help/repository/repo-create.png)
{% data reusables.command_line.open_the_multi_os_terminal %}
3. Change the current working directory to your local project.
4. Initialize the local directory as a Git repository.
```shell
$ git init -b main
```
5. Add the files in your new local repository. This stages them for the first commit.
```shell
$ git add .
# Adds the files in the local repository and stages them for commit. {% data reusables.git.unstage-codeblock %}
```
6. Commit the files that you've staged in your local repository.
```shell
$ git commit -m "First commit"
# Commits the tracked changes and prepares them to be pushed to a remote repository. {% data reusables.git.reset-head-to-previous-commit-codeblock %}
```
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.
![Copy remote repository URL field](/assets/images/help/repository/copy-remote-repository-url-quick-setup.png)
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> &lt;REMOTE_URL> </em>
# Sets the new remote
$ git remote -v
# Verifies the new remote URL
```
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
```
{% endmac %}
{% windows %}
1. [Create a new repository](/articles/creating-a-new-repository) on {% data variables.product.product_location %}. To avoid errors, do not initialize the new repository with *README*, license, or `gitignore` files. You can add these files after your project has been pushed to {% data variables.product.product_name %}.
![Create New Repository drop-down](/assets/images/help/repository/repo-create.png)
{% data reusables.command_line.open_the_multi_os_terminal %}
3. Change the current working directory to your local project.
4. Initialize the local directory as a Git repository.
```shell
$ git init -b main
```
5. Add the files in your new local repository. This stages them for the first commit.
```shell
$ git add .
# Adds the files in the local repository and stages them for commit. {% data reusables.git.unstage-codeblock %}
```
6. Commit the files that you've staged in your local repository.
```shell
$ git commit -m "First commit"
# Commits the tracked changes and prepares them to be pushed to a remote repository. {% data reusables.git.reset-head-to-previous-commit-codeblock %}
```
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.
![Copy remote repository URL field](/assets/images/help/repository/copy-remote-repository-url-quick-setup.png)
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> &lt;REMOTE_URL> </em>
# Sets the new remote
$ git remote -v
# Verifies the new remote URL
```
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
```
{% endwindows %}
{% linux %}
1. [Create a new repository](/articles/creating-a-new-repository) on {% data variables.product.product_location %}. To avoid errors, do not initialize the new repository with *README*, license, or `gitignore` files. You can add these files after your project has been pushed to {% data variables.product.product_name %}.
![Create New Repository drop-down](/assets/images/help/repository/repo-create.png)
{% data reusables.command_line.open_the_multi_os_terminal %}
3. Change the current working directory to your local project.
4. Initialize the local directory as a Git repository.
```shell
$ git init -b main
```
5. Add the files in your new local repository. This stages them for the first commit.
```shell
$ git add .
# Adds the files in the local repository and stages them for commit. {% data reusables.git.unstage-codeblock %}
```
6. Commit the files that you've staged in your local repository.
```shell
$ git commit -m "First commit"
# Commits the tracked changes and prepares them to be pushed to a remote repository. {% data reusables.git.reset-head-to-previous-commit-codeblock %}
```
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.
![Copy remote repository URL field](/assets/images/help/repository/copy-remote-repository-url-quick-setup.png)
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> &lt;REMOTE_URL> </em>
# Sets the new remote
$ git remote -v
# Verifies the new remote URL
```
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
```
{% endlinux %}
### Further reading
- "[Adding a file to a repository using the command line](/articles/adding-a-file-to-a-repository-using-the-command-line)"

View File

@@ -0,0 +1,44 @@
---
title: Importing a Git repository using the command line
intro: '{% if currentVersion == "free-pro-team@latest" %}If [GitHub Importer](/articles/importing-a-repository-with-github-importer) is not suitable for your purposes, such as if your existing code is hosted on a private network, then we recommend importing using the command line.{% else %}Importing Git projects using the command line is suitable when your existing code is hosted on a private network.{% endif %}'
redirect_from:
- /articles/importing-a-git-repository-using-the-command-line
- /github/importing-your-projects-to-github/importing-a-git-repository-using-the-command-line
versions:
free-pro-team: '*'
enterprise-server: '*'
github-ae: '*'
---
Before you start, make sure you know:
- Your {% data variables.product.product_name %} username
- The clone URL for the external repository, such as `https://external-host.com/user/repo.git` or `git://external-host.com/user/repo.git` (perhaps with a `user@` in front of the `external-host.com` domain name)
{% tip %}
For purposes of demonstration, we'll use:
- An external account named **extuser**
- An external Git host named `https://external-host.com`
- A {% data variables.product.product_name %} personal user account named **ghuser**
- A {% data variables.product.product_name %} repository named **repo.git**
{% endtip %}
1. [Create a new repository on {% data variables.product.product_name %}](/articles/creating-a-new-repository). You'll import your external Git repository to this new repository.
2. On the command line, make a "bare" clone of the repository using the external clone URL. This creates a full copy of the data, but without a working directory for editing files, and ensures a clean, fresh export of all the old data.
```shell
$ git clone --bare https://external-host.com/<em>extuser</em>/<em>repo.git</em>
# Makes a bare clone of the external repository in a local directory
```
3. Push the locally cloned repository to {% data variables.product.product_name %} using the "mirror" option, which ensures that all references, such as branches and tags, are copied to the imported repository.
```shell
$ cd <em>repo.git</em>
$ git push --mirror https://{% data variables.command_line.codeblock %}/<em>ghuser</em>/<em>repo.git</em>
# Pushes the mirror to the new {% data variables.product.product_name %} repository
```
4. Remove the temporary local repository.
```shell
$ cd ..
$ rm -rf <em>repo.git</em>
```

View File

@@ -0,0 +1,44 @@
---
title: Importing a repository with GitHub Importer
intro: 'If you have a project hosted on another version control system, you can automatically import it to GitHub using the GitHub Importer tool.'
redirect_from:
- /articles/importing-from-other-version-control-systems-to-github/
- /articles/importing-a-repository-with-github-importer
- /github/importing-your-projects-to-github/importing-a-repository-with-github-importer
versions:
free-pro-team: '*'
---
{% tip %}
**Tip:** GitHub Importer is not suitable for all imports. For example, if your existing code is hosted on a private network, our tool won't be able to access it. In these cases, we recommend [importing using the command line](/articles/importing-a-git-repository-using-the-command-line) for Git repositories or an external [source code migration tool](/articles/source-code-migration-tools) for projects imported from other version control systems.
{% endtip %}
If you'd like to match the commits in your repository to the authors' GitHub user accounts during the import, make sure every contributor to your repository has a GitHub account before you begin the import.
{% data reusables.repositories.migrating-from-codeplex %}
{% data reusables.repositories.repo-size-limit %}
1. In the upper-right corner of any page, click {% octicon "plus" aria-label="Plus symbol" %}, and then click **Import repository**.
![Import repository option in new repository menu](/assets/images/help/importer/import-repository.png)
2. Under "Your old repository's clone URL", type the URL of the project you want to import.
![Text field for URL of imported repository](/assets/images/help/importer/import-url.png)
3. Choose your user account or an organization to own the repository, then type a name for the repository on GitHub.
![Repository owner menu and repository name field](/assets/images/help/importer/import-repo-owner-name.png)
4. Specify whether the new repository should be *public* or *private*. For more information, see "[Setting repository visibility](/articles/setting-repository-visibility)."
![Public or private repository radio buttons](/assets/images/help/importer/import-public-or-private.png)
5. Review the information you entered, then click **Begin import**.
![Begin import button](/assets/images/help/importer/begin-import-button.png)
6. If your old project was protected by a password, type your login information for that project, then click **Submit**.
![Password form and Submit button for password-protected project](/assets/images/help/importer/submit-old-credentials-importer.png)
7. If there are multiple projects hosted at your old project's clone URL, choose the project you'd like to import, then click **Submit**.
![List of projects to import and Submit button](/assets/images/help/importer/choose-project-importer.png)
8. If your project contains files larger than 100 MB, choose whether to import the large files using [Git Large File Storage](/articles/versioning-large-files), then click **Continue**.
![Git Large File Storage menu and Continue button](/assets/images/help/importer/select-gitlfs-importer.png)
You'll receive an email when the repository has been completely imported.
### Further reading
- "[Updating commit author attribution with GitHub Importer](/articles/updating-commit-author-attribution-with-github-importer)"

View File

@@ -0,0 +1,22 @@
---
title: Importing source code to GitHub
intro: 'You can import repositories to GitHub using {% if currentVersion == "free-pro-team@latest" %}GitHub Importer, the command line,{% else %}the command line{% endif %} or external migration tools.'
redirect_from:
- /articles/importing-an-external-git-repository/
- /articles/importing-from-bitbucket/
- /articles/importing-an-external-git-repo/
- /articles/importing-your-project-to-github/
- /articles/importing-source-code-to-github
versions:
free-pro-team: '*'
enterprise-server: '*'
github-ae: '*'
children:
- /about-github-importer
- /importing-a-repository-with-github-importer
- /updating-commit-author-attribution-with-github-importer
- /importing-a-git-repository-using-the-command-line
- /adding-an-existing-project-to-github-using-the-command-line
- /source-code-migration-tools
---

View File

@@ -0,0 +1,53 @@
---
title: Source code migration tools
intro: You can use external tools to move your projects to GitHub.
redirect_from:
- /articles/importing-from-subversion/
- /articles/source-code-migration-tools
- /github/importing-your-projects-to-github/source-code-migration-tools
versions:
free-pro-team: '*'
enterprise-server: '*'
github-ae: '*'
---
{% if currentVersion == "free-pro-team@latest" %}
We recommend using [GitHub Importer](/articles/about-github-importer) to import projects from Subversion, Mercurial, Team Foundation Version Control (TFVC), or another Git repository. You can also use these external tools to convert your project to Git.
{% endif %}
### Importing from Subversion
In a typical Subversion environment, multiple projects are stored in a single root repository. On GitHub, each of these projects will usually map to a separate Git repository for a user account or organization. We suggest importing each part of your Subversion repository to a separate GitHub repository if:
* Collaborators need to check out or commit to that part of the project separately from the other parts
* You want different parts to have their own access permissions
We recommend these tools for converting Subversion repositories to Git:
- [`git-svn`](https://git-scm.com/docs/git-svn)
- [svn2git](https://github.com/nirvdrum/svn2git)
### Importing from Mercurial
We recommend [hg-fast-export](https://github.com/frej/fast-export) for converting Mercurial repositories to Git.
### Importing from TFVC
We recommend [git-tfs](https://github.com/git-tfs/git-tfs) for moving changes between TFVC and Git.
{% tip %}
**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 %}
{% if currentVersion == "free-pro-team@latest" %}
### Further reading
- "[About GitHub Importer](/articles/about-github-importer)"
- "[Importing a repository with GitHub Importer](/articles/importing-a-repository-with-github-importer)"
- [{% data variables.product.prodname_learning %}]({% data variables.product.prodname_learning_link %})
{% endif %}

View File

@@ -0,0 +1,41 @@
---
title: Updating commit author attribution with GitHub Importer
intro: 'During an import, you can match commits in your repository with the GitHub account of the commit author.'
redirect_from:
- /articles/updating-commit-author-attribution-with-github-importer
- /github/importing-your-projects-to-github/updating-commit-author-attribution-with-github-importer
versions:
free-pro-team: '*'
---
GitHub Importer looks for GitHub users whose email addresses match the authors of the commits in the repository you're importing. You can then connect a commit to its author using their email address or the author's GitHub username.
### Updating commit authors
1. After you've imported your repository, on the import status page, click **Match authors**.
![Match authors button](/assets/images/help/importer/match-authors-button.png)
2. Next to the author whose information you'd like to update, click **Connect**.
![List of commit authors](/assets/images/help/importer/connect-commit-author.png)
3. Type the email address or GitHub username of the author, then press **Enter**.
### Attributing commits to a GitHub user with a public email address
If the author of a commit in your imported repository has a GitHub account associated with the email address they used to author the commits, and they haven't [set their commit email address as private](/articles/setting-your-commit-email-address), GitHub Importer will match the email address associated with the commit to the public email address associated with their GitHub account, and attribute the commit to their GitHub account.
### Attributing commits to a GitHub user without a public email address
If the author of a commit in your imported repository has neither set a public email address on their GitHub profile, nor [set their commit email address as private](/articles/setting-your-commit-email-address), GitHub Importer may not be able to match the email address associated with the commit with their GitHub account.
The commit author can resolve this by setting their email address as private. Their commits will then be attributed to `<username>@users.noreply.github.com`, and the imported commits will be associated with their GitHub account.
### Attributing commits using an email address
If the author's email address is not associated with their GitHub account, they can [add the address to their account](/articles/adding-an-email-address-to-your-github-account) after the import, and the commits will be correctly attributed.
If the author does not have a GitHub account, GitHub Importer will attribute their commits to the email address associated with the commits.
### Further reading
- "[About GitHub Importer](/articles/about-github-importer)"
- "[Importing a repository with GitHub Importer](/articles/importing-a-repository-with-github-importer)"
- "[Adding an email address to your account](/articles/adding-an-email-address-to-your-github-account/)"
- "[Setting your commit email address](/articles/setting-your-commit-email-address)"