本人用flask已经在heroku部署完成
我需要修改代码重新提交,误将路径切换另外一个文件夹,将此错误文件夹的master分支提交到远程库了
命令为git push heroku master
而我切换到正确的代码文件夹再提交,提示
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to 'https://git.heroku.com/hulumei.git'
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 pull,则把远程仓库的错误代码和本地代码合并了,然后我在用git reset --hard 版本号命令回退到正确的节点,再提交到远程库,还是提示上面的信息
求大神解答?拜谢
如果你能确认你当前分支的代码是正确的。
撤销远程记录
git reset --hard HEAD~1
#撤销一条记录git push -f heroku HEAD:master
#同步到远程仓库git 撤销远程记录