我正在尝试通过网络界面或 Github 桌面应用程序将 Gist 回滚到旧状态。我看过solutions这似乎显示了如何使用命令行执行此操作。但是,我不知道如何在不使用命令行界面的情况下做到这一点。
CLI 是回滚历史记录的唯一方法吗?如果是这样,网络界面和桌面应用程序的这种限制是否有原因?
最佳答案
git 克隆
使用以下 URI 之一克隆你的 git
$ git clone git@gist.github.com:<gist_hash>
$ git clone git@github.com:<gist_hash>.git
# navigate to directory
$ cd <gist_hash>
rebase
根据需要更新分支,例如使用 rebase
$ git rebase --interactive
pick 8c199dc 8c199dc373b5be96df92131e3c0631514636583d
- pick dc968d3 dc968d3e2cb3a571ed50233047c3d83ba3f6e209
强制推送
您必须强制推送您的更改以覆盖以前的提交
$ git push -f
关于git - 使用 Github 网络界面或桌面应用程序将 Gist 重置或恢复到较旧的提交状态,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32351802/