How to get certain commit from GitHub project

后端 未结 11 1228
名媛妹妹
名媛妹妹 2020-12-07 07:27

I need to download the Facebook API from GitHub. Normally, I just click on the \'Downloads\" tab to download the latest source code. In this case, I need an older commit: 91

11条回答
  •  一整个雨季
    2020-12-07 08:08

    First, clone the repository using git, e.g. with:

    git clone git://github.com/facebook/facebook-ios-sdk.git
    

    That downloads the complete history of the repository, so you can switch to any version. Next, change into the newly cloned repository:

    cd facebook-ios-sdk
    

    ... and use git checkout to change to the right commit:

    git checkout 91f25642453
    

    That will give you a warning, since you're no longer on a branch, and have switched directly to a particular version. (This is known as "detached HEAD" state.) Since it sounds as if you only want to use this SDK, rather than actively develop it, this isn't something you need to worry about, unless you're interested in finding out more about how git works.

提交回复
热议问题