Skip to main content

Using the command line to import source code

To import source code that is not accessible from the public internet, you can use command line tools.

About source code imports using the command line

You can use command line tools to import source code and its revision history to GitHub.

Adding locally hosted code to GitHub

If your code is stored locally on your computer and is tracked by Git or not tracked by any version control system (VCS), you can import the code to GitHub using GitHub CLI or Git commands.

Importing an external Git repository using the command line

If your Git repository is stored on a code hosting service that is not accessible from the public internet, you can import the repository using Git on the command line.

Importing a Subversion repository

You can import a repository from Subversion by converting the repository to Git, then pushing the Git repository to GitHub.

Importing a Mercurial repository

You can import a repository from Mercurial by converting the repository to Git, then pushing the Git repository to GitHub.

Importing a Team Foundation Version Control repository

You can import a repository from Team Foundation Version Control (TFVC) by converting the repository to Git, then pushing the Git repository to GitHub.