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

转载 2015年11月18日 19:30:15

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了。


相关文章推荐

git 基本步骤

1:首先,跳转到项目根目录 Administrator@JS-PC /e/abc $ cd CanYin-www Administrator@JS-PC /e/abc/CanYin-www (m...
  • gjswxhb
  • gjswxhb
  • 2014年04月08日 23:58
  • 14514

【Git入门之九】解决冲突

1.多人协作冲突 如果多人同时修改了同一个文件,那会出现什么样的结果呢?我们试着这么做。 (1)修改jackygit2 在jackygit2中修改jackydata01,提交修改并推送到远...

git error:Updates were rejected because the tip of your current branch is behind

var username = "huangbin10025"; var _blogger = username; var blog_address = "http://blog.csd...

github(To prevent you from losing history, non-fast-forward updates were rejected)

[admin@bogon project]$ git push To https://admin-zou@github.com/admin-zou/project.git ! [rejected] ...

【Git & GitHub】解决办法:Could not read from remote repository.Please make sure you have the...

问题描述:执行git pull的时候出现下列错误信息 Could not read from remote repository.Please make sure you have the corr...

No compatible targets were found,Do you wish to add a new Android Virtual Device?问题解决方法。

当一个android项目要在虚拟机上测试时,有时会发现提示No compatible targets were found,Do you wish to add a new Android Virtu...

【git使用】Permission denied (publickey). fatal: Could not read from remote respository.解决办法

【git使用】Permission denied (publickey). fatal: Could not read from remote respository.解决办法问题描述:执行 $ g...

安装sql server 2016报错误1402(请验证您是否具有足够的权限访问该项/Verify that you have sufficient access to that key)的解决办法

SQL Server Setup fails to Install with Error 1402

git pull时遇到git pull error :error: remote ref is at but expected问题的解决办法

今天在拉取项目新版本的代码时,遇到了一个问题,对项目最新的代码进行git pull,报错:error: cannot lock ref 'xxx': ref xxx is at (一个commitID...
  • ShorewB
  • ShorewB
  • 2016年06月01日 20:24
  • 1823

gdb提示“you can't do that without a process to debug"解决方法

最近在做一个IDE,底层通过mi接口调用的gdb做调试。 因为要支持尽可能广的gdb版本,而gdb/mi接口偶有更新,最省事的处理方法无疑是调用旧版本有,新版本虽deprecated但也支持的接口。...
  • ljqx88
  • ljqx88
  • 2012年09月16日 10:30
  • 3648
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:git Updates were rejected because the remote contains work that you do 解决办法
举报原因:
原因补充:

(最多只允许输入30个字)