How do I download my whole repository from GitLab?

85,061

I can't work out how to download my entire repository for a given project.

Use git clone.

This procedure assumes you have already created a repository on GitHub, or have an existing repository owned by someone else you'd like to contribute to.

  • On GitHub, navigate to the main page of the repository.

  • Under the repository name, click Clone or download.

    enter image description here

  • In the Clone with HTTPs section, click to copy the clone URL for the repository.

    enter image description here

  • Open Git Bash.

  • Change the current working directory to the location where you want the cloned directory to be made.

  • Type git clone, and then paste the URL you copied in Step 2.

    git clone https://github.com/YOUR-USERNAME/YOUR-REPOSITORY
    
  • Press Enter. Your local clone will be created.

    git clone https://github.com/YOUR-USERNAME/YOUR-REPOSITORY
    Cloning into `Spoon-Knife`...
    remote: Counting objects: 10, done.
    remote: Compressing objects: 100% (8/8), done.
    remove: Total 10 (delta 1), reused 10 (delta 1)
    Unpacking objects: 100% (10/10), done.
    

Source Cloning a repository - User Documentation

Share:
85,061

Related videos on Youtube

mike rodent
Author by

mike rodent

Updated on September 18, 2022

Comments

  • mike rodent
    mike rodent over 1 year

    I can't work out how to download my entire repository for a given project. Most of the things I do seem to just download the latest snapshot, e.g.

    git pull https://gitlab.com/blahblah/MyProject.git
    

    The reason I want to know how to do this is for "recovery" purposes: accidental deletion, if my PC blew up, got stolen, etc.

    There doesn't seem to be a "forum" as such for GitLab, hence my posting here.

    • Ignacio Vazquez-Abrams
      Ignacio Vazquez-Abrams about 6 years
      Every clone is the repository (or some subset of branches). That's the point of DVCSes.
    • mafu
      mafu over 4 years
      @IgnacioVazquez-Abrams No, it is missing lost branches etc.
  • mike rodent
    mike rodent about 6 years
    Thanks... actually I had already found that page and tried that command... I should have clarified the problem: I found that the result of clone does indeed include a .git subdirectory... but the objects/ directory under it is only 650 kB... whereas the objects/ directory under the .git subdirectory in the local repository is 2.58 MB. I had wrongly (I presume) assumed that this meant it wasn't a true/complete clone. What I really need is an explanation of this volume difference...
  • victe
    victe almost 6 years
    OP asks for gitlab, no github, but it is essentially the same.