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

来源:互联网 发布:淘宝自制女装销量好高 编辑:程序博客网 时间:2024/06/10 18:45

Username for 'https://github.com': dummymarePassword 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 dohint: not have locally. This is usually caused by another repository pushinghint: to the same ref. You may want to first integrate the remote changeshint: (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了。


1 2
原创粉丝点击