git - git重置了,现在我无法推送
问题描述
在我执行“git reset hard”回到旧提交后我应该做什么?我在 heroku 上部署了一个站点,并且我的代码搞砸了,所以我只是做了一个“git reset,我从来没有做过。我在 VSCode 上的代码回到了我想要的方式,但是当我尝试做”git push origin master”或“git push heroku master”,它给了我hint: Updates were rejected because the tip of your current branch is behind hint: its remote counterpart. Integrate the remote changes (e.g. hint: 'git pull ...') before pushing again. hint: See the 'Note about fast-forwards' in 'git push --help' for details.
我试过查找它并弄乱了我发现的一些东西,但它真的让我感到困惑和陌生。我该如何推动这个旧版本的网站现在?
解决方案
你需要用力推动它
git push -f origin master
如果你不喜欢强制推送到 master,你可以创建一个新的分支来推送,然后合并或做一个 PR。
推荐阅读
- php - 带有 MAMP 的 MacOS Mojave 上的 VirtualHost 不起作用
- python - requests-html 找不到页面元素
- struct - 我应该将文本输入解析为“动态结构”以对其进行逻辑处理吗?
- c# - 为什么我在生产中使用 .NET MVC 5 Web APP 访问生产中的 Web API 时收到 404 错误,而不是开发中
- active-directory - 将 SSO 与 Coldfusion 应用程序集成
- apollo-server - GraphQLError:预期类型 Int,找到 Int
- php - PHP不会从数据库中获取数据,显示一个空白页?
- php - 致命错误:在 php mvc 中找不到类“控制器”
- android - ActivityCompat onRequestPermissionsResult() 未调用
- python - np.where 覆盖 th 值