-
Is there a way to fetch a single file from a remote? I am working on a small project and would like to fetch the is there a way to just get the single file or do I need to clone the whole repo into my filesystem and get the file then? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
The git protocol does not allow to fetch individual objects unless their git-hash is known, which is probably not the case here. Otherwise one can only limit the amount of data cloned, which is probably easiest by making a shallow clone. It's probably better to fall back to that only when there is on cloud-provider, and do an HTTP fetch of the respective file from GitHub/GitLab/… instead. |
Beta Was this translation helpful? Give feedback.
The git protocol does not allow to fetch individual objects unless their git-hash is known, which is probably not the case here.
Otherwise one can only limit the amount of data cloned, which is probably easiest by making a shallow clone.
It's probably better to fall back to that only when there is on cloud-provider, and do an HTTP fetch of the respective file from GitHub/GitLab/… instead.