如何解决failed to push somegit push refs tagso git

git&push时&报错&error:&failed&to&push&some&refs&to
参考:http://my.oschina.net/banxi/blog/78158
git push origin master 失败
错误信息:
remote: error: refusing to update checked out branch:
refs/heads/master
remote: error: By default, updating the current branch in a
non-bare repository
remote: error: is denied, because it will make the index and work
tree inconsistent
remote: error: with what you pushed, and will require 'git reset
--hard' to match
remote: error: the work tree to HEAD.
remote: error:
remote: error: You can set 'receive.denyCurrentBranch'
configuration variable to
remote: error: 'ignore' or 'warn' in the remote repository to allow
pushing into
remote: error: however, this is not recommended
unless you
remote: error: arranged to update its work tree to match what you
pushed in some
remote: error: other way.
remote: error:
remote: error: To squelch this message and still keep the default
behaviour, set
remote: error: 'receive.denyCurrentBranch' configuration variable
to 'refuse'.
To test_project
&! [remote rejected] master -& master (branch
is currently checked out)
error: failed to push some refs to 'test_project'
解决办法:
在创建仓库时,加上 --bare
git init --bare
已投稿到:
以上网友发言只代表其个人观点,不代表新浪网的观点或立场。Git error (failed to push some refs)解决 - CSDN博客
Git error (failed to push some refs)解决
当修改了本地仓库后 提交代码时, 用 git push 提示以下错误
error:failed to push some refs to ...
Dealing with “non-fast-forward” errors
From time to time you may encounter this error while pushing:
$ git push origin master
To ../remote/
! [rejected]
master -& master (non-fast forward)
error: failed to push some refs to '../remote/'
To prevent you from losing history, non-fast-forward updates were rejected
Merge the remote changes before pushing again.
See the 'non-fast forward'
section of 'git push
解决办法:
先把git的东西fetch到你本地然后merge后再push
$ git fetch
$ git merge
$ git push
本文已收录于以下专栏:
相关文章推荐
github commit 报错:error: failed to push some refs to 'https:'错误解决方法
执行git push文件的时候出现下面的错误:
To https://git./kanghuaisong/Git_demo.git
! [rejected]
在使用git 对源代码进行push到gitHub时可能会出错,信息如下
此时很多人会尝试下面的命令把当前分支代码上传到master分支上。
$ git push -u origin master...
Administrator@PC-FGWU /K/cocos2d/yc (master)
$ git push -u origin master
本人在使用git提交代码的时候发现错误,错误如下:
feixiang@FEIXIANG-PC /d/workspace/fanjf (master)
$ git push -u origin mas...
git中failed to push some refs to git问题解决及基本使用
Java代码  
#mib.properties  
#Fri Jul 11 15:57:28 CST ; 
1.3.6.1.2.1.1.6.0=beijing&#...
1、安装msysgit和TortoiseGit ;
2、TortoiseGit 设置:
(1)、确保安装成功:
(2)、设置用户名和邮箱:
3、登陆github并进入设置页面:
4、添加 SS...
SNMP监控一些常用OID的总结
系统参数(1.3.6.1.2.1.1)
.1.3.6.1.2.1.1.1.0
获取系统基本信息...
$ git push origin master
Warning: Permanently added the RSA host key for IP address '192.30.253.112'...
他的最新文章
讲师:宋宝华
讲师:何宇健
您举报文章:
举报原因:
原文地址:
原因补充:
(最多只允许输入30个字)git push 失败 failed to push some refs to git - 简书
git push 失败 failed to push some refs to git
在使用git 对源代码进行push到gitHub时可能会出错,error: failed to push some refs to git。
出现如上图中错误的主要原因是github中的README.md文件不在本地代码目录中。
可以通过如下命令进行github与本地代码合并:
git pull --rebase origin master
执行上面代码后可以看到本地代码库中多了README.md文件。
重新执行之前的git push 命令,成功!
生活就是代码与诗!

我要回帖

更多关于 git pull failed 的文章

 

随机推荐