Revert GitHub Commit History?
2019-05-03
There is a piece of nicely given advice I’d like to share with you: do never post anything too large on your Hexo blog. The suggestion given above was a joke to me until yesterday. I thought I can just wait for some more minutes and then everything will be fine. Pages will end up posted with probability one in the long run — well, they didn’t make it this time. The html files were so big that GitHub returned a file oversize error and rejected my push from Hexo. Everything got messy and however I tried, deployment was always rejected.
If you also encounter this problem, well, lucky you, cause I’ve managed a fix to it. The first step would be locating the .git
folder in our hexo directory. Here I used the builtin command
find . -name ".git"
under the hexo
folder. The corresponding location was hexo/.deploy_git
. Then we enter this directory and go onto our step 2, which is basically git commit history reversion. First go to the GitHub website and find an earlier commit and copy its SHA codes. Then, in the terminal we opened, enter:
git reset --hard {{SHA}}
and then make a regular push.