Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Update importing-a-git-repository-using-the-command-line.md #23548

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Feb 13, 2023
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
---
title: Importing a Git repository using the command line
title: Importing an external Git repository using the command line
intro: '{% ifversion fpt %}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
- /github/importing-your-projects-to-github/importing-source-code-to-github/importing-a-git-repository-using-the-command-line
- /get-started/importing-your-projects-to-github/importing-source-code-to-github/importing-a-git-repository-using-the-command-line
versions:
fpt: '*'
ghes: '*'
Expand All @@ -29,7 +30,7 @@ For purposes of demonstration, we'll use:
{% endtip %}

1. [Create a new repository on {% data variables.product.product_name %}](/repositories/creating-and-managing-repositories/creating-a-new-repository). You'll import your external Git repository to this new repository.
2. On the command line, make a "bare" clone of the 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.
2. On the command line, make a "bare" clone of the external repository using the external clone URL. This creates a full copy of the data, but without a working directory for editing files, and ensures a clean, fresh export of all the old data.
```shell
$ git clone --bare https://external-host.com/EXTUSER/REPO.git
# Makes a bare clone of the external repository in a local directory
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ 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
- /importing-an-external-git-repository-using-the-command-line
- /adding-locally-hosted-code-to-github
- /source-code-migration-tools
shortTitle: Import code to GitHub
Expand Down