gitgit-remotegit-fetchupstream-branch

How to sync a downloaded zip with upstream without downloading the files again?


I downloaded llvm as a zip a while ago. It's a big repo, so I don't want to download the files again, I don't want the history either. However, I'd like to have future changes the main repo present locally with the changes I make for my own. I imagine it is possible with some rebase/merge.

I tried

git init
git remote add origin https://github.com/llvm/llvm-project.git
git fetch --depth 1 

but it costs me bandwidth again:

Enumerating objects: 426325, done.
remote: Counting objects: 100% (426325/426325), done.
remote: Compressing objects: 100% (228729/228729), done.
Receiving objects:  14% (60241/426325), 32.60 MiB | 672.00 KiB/s   

Solution

  • A zip file of the files extracted from a commit is not a commit itself, and has no history.

    A --depth 1 clone of a repository has one commit, but has defeated Git's ability to make what Git calls thin packs. There is no in-Git solution to this.