-1

I have a repo downloaded by zip, and i want to do a git clone but detecting all the files that i already have and not clone all the repo.

is it possible ?

To just update Git index of the folder and detect all the files i already have in order to continue working like always ?

The repo is in gitlab

WhySoBizarreCode
  • 57
  • 1
  • 1
  • 8
  • so there is already a repo. you only want to download the files that are added later. Why dont you just use normal git? and instead downloading why not just clone first and git pull each time new file appears? Thats exactly why we use git at the end right? – Ayon Nahiyan Mar 05 '21 at 21:05

1 Answers1

1

It isn't possible to clone a repo more efficiently with only an archive of a single commit.

In order to find out the data that both sides have, the client and server negotiate a set of common commits and tags. This may happen several times. Once the server knows what the client has and what it wants, it sends the rest. If the client says that it has revision A, for example, then the server knows, unless the client has said that it is shallow or partial, that the client must have all items preceding A in the history.

In your case, you don't have any commit objects, and you can't create a commit object that the server knows about, since you don't have the preceding objects to do so. Even if you did create a new repository with a single commit, the server wouldn't know about it and couldn't send you less data as a result.

So that's why you really cannot clone a repository having had only a zip file of a single revision. You'll just have to do a fresh clone.

bk2204
  • 64,793
  • 6
  • 84
  • 100