gpt4 book ai didi

Git 恢复 heroku 中的最后一次提交

转载 作者:IT王子 更新时间:2023-10-29 00:46:19 25 4
gpt4 key购买 nike

我做了一个提交并将它推送到 origin 和 heroku

然后我意识到这是错误的,所以我做了

git reset --soft HEAD^ 

但是当我推送到 Heroku 时,我得到了

To git@heroku.com:app.git
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to 'git@heroku.com:app.git'
To prevent you from losing history, non-fast-forward updates were rejected
Merge the remote changes (e.g. 'git pull') before pushing again. See the
'Note about fast-forwards' section of 'git push --help' for details.

我明白这个问题。我该如何进行?我怎样才能恢复最后一次 heroku 提交? (我认为这将是最好的解决方案)

最佳答案

如果您已在本地还原提交,您可能需要使用 -f 选项来 git push 以强制提交。

此外,您可能想看看 Heroku releases这也可能有帮助。

关于Git 恢复 heroku 中的最后一次提交,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5248103/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com