Open yingxiaoGuo opened 4 years ago
(this is a followup to: https://stackoverflow.com/questions/600079/how-do-i-clone-a-subdirectory-only-of-a-git-repository/52269934#52269934 )
Hi Yingxia,
In theory both of hose should be possible.
All git needs to create the new objects are the old commit object, and the directories leading to the blob.
The a git push only pushes the new objects.
You can familiarize yourself further with the format of Git objects at: https://stackoverflow.com/questions/22968856/what-is-the-file-format-of-a-git-commit-object-data-structure/37438460#37438460
Branches should also work in theory. In theory, you can request only whatever objects you need from remote to reach to reach a given local state.
Of course, if this will be actually done on those early implementations, I don't know.
Hi! I am here for a StackOverflow question.
Where you give the answer about cloning a subdirectory only of a Git repository:
That is really useful! But I am wondering if I could further update the cloned subdirectory and it is possible to pull another branch from the remote.
Thanks in advance for your reply!