Git 无法推送一些参考,更新被拒绝
Git Failes to push some refs, Updates were rejected
我在尝试推送更改时收到此消息。如何合并我的本地存储库和远程存储库?我复制了项目文件夹并做了:
git init
git remote add Myprojectname path-to-my-project.git
git commit -a -m "msg"
git pull origin master
git push origin mybranch
我收到这个错误:
Git Failes to push some refs, Updates were rejected because the tip of your current branch is behind its remote changes.
如何解决?提前致谢!
你为什么添加那个遥控器? git remote add Myprojectname path-to-my-project.git
。据我所知,您应该在添加 github 项目时添加 git remote add origin path-to-my-project.git
。请使用此命令 git remote rm myproject
和 git remote rm origin
删除 Myprojectname
遥控器,然后像那样添加遥控器 git remote add origin https://github.com/user/repo.git
。然后你可以拉动它。顺便说一句,在这种情况下你不必指定来源,只需 git push
我在尝试推送更改时收到此消息。如何合并我的本地存储库和远程存储库?我复制了项目文件夹并做了:
git init
git remote add Myprojectname path-to-my-project.git
git commit -a -m "msg"
git pull origin master
git push origin mybranch
我收到这个错误:
Git Failes to push some refs, Updates were rejected because the tip of your current branch is behind its remote changes.
如何解决?提前致谢!
你为什么添加那个遥控器? git remote add Myprojectname path-to-my-project.git
。据我所知,您应该在添加 github 项目时添加 git remote add origin path-to-my-project.git
。请使用此命令 git remote rm myproject
和 git remote rm origin
删除 Myprojectname
遥控器,然后像那样添加遥控器 git remote add origin https://github.com/user/repo.git
。然后你可以拉动它。顺便说一句,在这种情况下你不必指定来源,只需 git push