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
Sivan's answer in gif
1.Click on commits in github
2.Select Browse code on the right side of each commit
3.Click on download zip , which will download source code at that point of time of commit
To just download a commit using the 7-digit SHA1 short form do:
Working Example:
https://github.com/python/cpython/archive/31af650.zip
Description:
`https://github.com/username/projectname/archive/commitshakey.zip`
If you have the long hash key
31af650ee25f65794b75d4dfefed6fe4758781c1
, just get the first 7 chars31af650
. It's the default for GitHub.
If you want to go with any certain commit or want to code of any certain commit then you can use below command:
git checkout <BRANCH_NAME>
git reset --hard <commit ID which code you want>
git push --force
Example:
git reset --hard fbee9dd
git push --force
The easiest way that I found to recover a lost commit (that only exists on github and not locally) is to create a new branch that includes this commit.
git pull
the new branch down to localThe question title is ambiguous.
Try the following command sequence:
$ git fetch origin <copy/past commit sha1 here>
$ git checkout FETCH_HEAD
$ git push origin master