github - fetch git repo at specific commit without cloning -


i trying git repo @ specific commit hash without cloning! every example wants clone whole repo. makes sense repo have in mind huge , need leave small footprint going docker image.

the commit hash in url - either wget or curl could/should recursively fetch have feeling github blocking ever robots.txt

the repo , commit:

https://github.com/phalcon/cphalcon/tree/1d6d21c98026b5de79ba5e75a3930ce7d1ebcd2e

my best attempt error:

git fetch https://github.com/phalcon/cphalcon/ 1d6d21c98026b5de79ba5e75a3930ce7d1ebcd2e error: server not allow request unadvertised object 1d6d21c98026b5de79ba5e75a3930ce7d1ebcd2e 

update

suggestions of answers use clone aren't answering question. can clone/checkout no problem. trying without having whole repo locally

you need git repository, reason shown in error message:

error: server not allow request unadvertised object ... 

an "unadvertised object" 1 not have name directly attached it. (if object had name, ask named thing, , server give object. assumes complaint "i don't allow blue cats here" implies "i allow other colors of cats", isn't true either, it's kind of reasonable assumption.1) means must obtain object indirect means, i.e., using git fetch.

the repository need is, definition, clone—or @ least partial clone—of original repository. can use shallow clone, 1 incomplete. precisely depth necessary cannot compute in advance: has full clone figure out, , once have deep enough clone, can find exact number. if clone shallow, know clone shallow.

see git fetch specific commit hash , git shallow clone (clone --depth) misses remote branches. note may or may not want --single-branch. clone depth , see if it's enough, , if not, raise depth git fetch --depth <bigger-number> until enough.


1in fact, logic appears true origin phrase "the exception proves rule": comes latin phrase exceptio probat regulam in casibus non exceptis. see https://pocketbookuk.com/tag/cicero/ , this answer on english.stackexchange.com more on this.


Comments

Popular posts from this blog

ZeroMQ on Windows, with Qt Creator -

unity3d - Unity SceneManager.LoadScene quits application -

python - Error while using APScheduler: 'NoneType' object has no attribute 'now' -