How to get certain commit from GitHub project

后端 未结 11 1287
名媛妹妹
名媛妹妹 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:16

    write this to see your commits

    git log --oneline
    

    copy the name of the commit you want to go back to. then write:

    git checkout "name of the commit"
    

    when you do this, the files of that commit will be replaced with your current files. then you can do whatever you want to these and once you're done, you can write the following command to extract the current files into another newly created branch so whatever you make doesn't have any danger for the previous branch that you extracted a commit from

    git checkout -b "name of a branch to extract the files to"
    

    right now, you have the content of a specified commit, into another branch .

提交回复
热议问题