3 ms·
Shallow cloning of Git repos is a thing. Basically, you get a fake head commit (that includes all the files) and none of the real history. Useful if you only
by rvbissell 4y ago
Shallow cloning of Git repos is a thing. Basically, you get a fake head commit (that includes all the files) and none of the real history. Useful if you only intend to build, or make changes locally. If you want to push, you have to unshallow first.
- someguy101010 4y agowould be cool to be able to commit without unshallowing first
- phil-m 4y agoNot possible, due to the way how git works: It's a merkle tree of commits, where each of these commits point to a file tree (content-addressed by the hash) and the previous commit
- iudqnolq 4y agoNo, creating a git commit merely requires knowing the current state of all the files and the hash of the previous commit. You don't need the actual contents of the previous commits. https://git-scm.com/book/en/v2/Git-Internals-Git-Objects https://git-scm.com/book/en/v2/Git-Internals-Git-Objects Pushing from a shallow clone to a remote is more complex, but is supported in modern git versions. https://stackoverflow.com/a/6900428 https://stackoverflow.com/a/6900428