将提交推送到github存储库引发错误

将提交推送到github存储库引发错误,github,git-bash,git-push,Github,Git Bash,Git Push,我得到的错误是: To https://github.com/Git-Username/Repo.git ! [rejected] master -> master (non-fast-forward) error: failed to push some refs to 'https://github.com/user/repo.git' hint: Updates were rejected because the tip of your current branch

我得到的错误是:

To https://github.com/Git-Username/Repo.git
 ! [rejected]        master -> master (non-fast-forward)
error: failed to push some refs to 'https://github.com/user/repo.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 push origin master
当我在谷歌上搜索这个错误时,我尝试了几乎所有的方法,我试着拉等等

我试过拉等等

拉动应该足以解决问题

但是如果您的本地历史记录是正确的(
git log
),并且您是唯一一个推送到该存储库的人,那么您也可以简单地强制推送

git push --force -u origin master

这将覆盖遥控器上的历史记录。

你是一个传奇,非常感谢你,我已经尝试学习git一段时间了,但我接触的许多社区都没有帮助,你是一个国王!