简体   繁体   English

git无法将我的更新推送到远程

[英]git can't push my updates to remote

$ git log
 commit 49a37bc9fd27c909e4fe77812041fd38b9755f61 (HEAD -> master)
 Author: chenghuang <574637816@qq.com>
 Date:   Thu Dec 7 14:15:42 2017 +0900

useless

commit e9b08e2b428f9dd58aa0b792ebeb29da4270dfab
Author: chenghuang <574637816@qq.com>
Date:   Tue Dec 5 22:45:31 2017 +0900

20171205_Checklist_well

I just have to commits in my git log. 我只需要在git日志中提交即可。

$ git branch #my current branch is master
 * master

$ git remote -v #This is my remote github url
origin  https://github.com/ekoopgj/Shell_learning.git (fetch)
origin  https://github.com/ekoopgj/Shell_learning.git (push)    

$ git push -u origin master
Username for 'https://github.com':
Password for 'https://ekoopgj@github.com':
To https://github.com/ekoopgj/Shell_learning.git
! [rejected]        master -> master (fetch first)
error: failed to push some refs to 'https://github.com/ekoopgj/Shell_learning.git'
 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.

I can't push my updates to remote . 我无法将更新推送到remote。 What's it mean that "remote work contains that you do"? “远程工作包含您的工作”是什么意思?

The full sentence is 完整的句子是

the remote contains work that you do not have locally.

That means someone has pushed on the remote master before you. 这意味着有人在您之前推动了远程主服务器。

A git pull (or better: git pull --rebase ) will allow you to get those modification, and to push yours back. git pull (或者更好的是git pull --rebase )将允许您进行修改,然后将其推回去。

This means that your copy of source code is not latest and causing mismatch. 这意味着您的源代码副本不是最新的,并导致不匹配。 Take latest from master, may be in other location merge your changes with it and then try to push again 掌握最新信息,可能在其他位置将您的更改与之合并,然后尝试再次推送

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM