Is it possible to revert a commit through GitHub's web interface

我的未来我决定 提交于 2019-12-12 10:49:09

问题


I'm teaching a HTML class on Chromebooks. We're using GitHub for both revision control and I'd like to show my students how to revert a commit. Since we don't have shell access on the Chromebooks I was hoping to find a way to do this online, through the GitHub website. Is that possible? I'm starting to think it might not be.


回答1:


You can't. GitHub does not have a web API call to do this.

The full API can be found here.


What can you do?

Since we don't have shell access on the Chromebooks...

You can always revert locally and then push your code with -f to force the code to be pushed, but since you don't have command line to do it you will need to manually revert your code and commit the "old" code back.

If you do have the option to use a CLI, rather than the GitHub website, take a look at this answer. It will be very helpful for you. It describes in detail how to revert commits in various ways using the CLI.

How to move HEAD back to a previous location? (Detached head)



来源:https://stackoverflow.com/questions/35300297/is-it-possible-to-revert-a-commit-through-githubs-web-interface

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!