Retrieve specific commit from a remote Git repository

后端 未结 10 1795
谎友^
谎友^ 2020-11-22 06:32

Is there any way to retrieve only one specific commit from a remote Git repo without cloning it on my PC? The structure of remote repo is absolutely same as that of mine and

10条回答
  •  孤城傲影
    2020-11-22 06:46

    This works best:

    git fetch origin specific_commit
    git checkout -b temp FETCH_HEAD
    

    name "temp" whatever you want...this branch might be orphaned though

提交回复
热议问题