git Updates were rejected because the remote contains work that you do 解决办法

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

进入项目目录后,执行 git pull 命令,没有将项目更新,并提示下图:

qq_20131210105027

2、If you wish to set tracking information for this branch you can do so with:

git branch --set-upstream-to=origin/<branch> master

使用上面的命令就可以将本地的分支和远程分支进行关联了。

如下:

<a href="http://www.tbdazhe.com/wp-content/uploads/2013/12/QQ_20131210110802.jpg" class="cboxElement" rel="example4" 238"="" style="text-decoration: none; color: rgb(1, 150, 227);">QQ_20131210110802

 

如图:再执行git pull 就显示已经ok了。


阅读更多
个人分类: iOS
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页

不良信息举报

git Updates were rejected because the remote contains work that you do 解决办法

最多只允许输入30个字

加入CSDN,享受更精准的内容推荐,与500万程序员共同成长!
关闭
关闭