-1

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?

dumbledad
  • 16,305
  • 23
  • 120
  • 273

1 Answers1

1

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

dumbledad
  • 16,305
  • 23
  • 120
  • 273
CodeWizard
  • 128,036
  • 21
  • 144
  • 167
  • This does not seem to work for me. `git branch` shows I have two local branches, while `git ls-remote` lists sixteen branches. After I run `git fetch --all --prune` if I rerun `git branch` I still only see two branches. – dumbledad Jan 09 '16 at 17:25
  • 1
    type: `git branch -a` which stands for all. without the `-a` you only print your local branches – CodeWizard Jan 09 '16 at 17:26