使用Git推送到Github发生错误

时间:2015-08-05 19:10:18

标签: git github git-gui

所以我的文件被上传到git-GUI。按提交工作正常。单击按钮并询问我的目标存储库,因此我放了https://github.com/myusername/reposistoryname然后按回车键,之后它会询问我的用户名和密码。输入这些项目后,我收到此错误消息。

Pushing to https://github.com/myusername/reposistoryname
To https://github.com/myusername/reposistoryname
! [rejected]        master -> master (fetch first)
error: failed to push some refs to 'https://github.com/emaoll/pnz'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

我有一个github帐户以及github上的存储库。

2 个答案:

答案 0 :(得分:0)

你写完了......提交你的更改,然后提取数据。成功拉动后,您可以再次推送数据。

答案 1 :(得分:0)

您需要将更改集成到远程brance中(就像所说的消息一样),如果您想要进行更改并查看它,则必须使用..

git fetch origin //Bring all the changes from the remote server

但是,您想要推送本地更改,那么您必须使用...

git pull //Fetch down new data  from remote server

之后,您可以正常使用'git push'命令。其实你也可以用......

git status //This command bring to you some help, about what's next.
  

我向你推荐,使用(编写那些命令)Git Bash(命令行), - 对我来说 - 它更容易。或者如果您愿意,可以使用Git-GUI,只需转到远程菜单>取

问候!