A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://help.github.com/articles/importing-a-git-repository-using-the-command-line/ below:

Importing an external Git repository using the command line

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.

Before you start, make sure you know:

Note

For purposes of demonstration, we'll use:

  1. Create a new repository on GitHub. You'll import your external Git repository to this new repository.

  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.

    $ git clone --bare https://external-host.com/EXTUSER/REPO.git
    # Makes a bare clone of the external repository in a local directory
    
  3. Push the locally cloned repository to GitHub using the "mirror" option, which ensures that all references, such as branches and tags, are copied to the imported repository.

    $ cd REPO.git
    $ git push --mirror https://github.com/USER/REPO.git
    # Pushes the mirror to the new repository on GitHub.com
    
  4. Remove the temporary local repository.

    cd ..
    rm -rf REPO.git
    

If the repository you are importing contains large files, you may run into a warning or error. For more information on large files and how to manage them, see About large files on GitHub.

Further reading

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4