Search code examples
gitgit-clone

How do I get from my local repository to a full clone?


If I am starting from scratch I can clone a remote git repository using the command

git clone --mirror <repository-url>

(Documentation.)

However I am not starting from scratch, I already have several branches locally (tracking the remote): all the ones I made and the branch called 'master'.

How do I get from this 'partial clone' to a full clone? I could list all the branches and tags on the remote repository and fetch them one by one, but is there a command like git clone that will catch my local repository up with the remote one?


Solution

  • How do I get from this 'partial clone' to a full clone

    What you are lookiing for is called fetch

    # update my local repo with all the data from the remote server 
    git fetch --all --prune
    

    enter image description here