git push origin master出现如下错误:

Counting objects: , done.
Writing objects: % (/),  bytes, done.
Total  (delta ), reused  (delta )
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: its current branch; 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 git@192.168.45.42:teamwork.git
 ! [remote rejected] master -> master (branch is currently checked out)
error: failed to push some refs to 'git@192.168.45.42:teamwork.git'

执行命令解决问题
git config receive.denyCurrentBranch ignore  

git pull出现如下错误:
You asked me to pull without telling me which branch you
want to merge with, and 'branch.master.merge' in
your configuration file does not tell me, either. Please
specify which branch you want to use on the command line and
try again (e.g. 'git pull <repository> <refspec>').
See git-pull() for details.

If you often merge with the same branch, you may want to
use something like the following in your configuration file:

    [branch "master"]
    remote = <nickname>
    merge = <remote-ref>

    [remote "<nickname>"]
    url = <url>
    fetch = <refspec>

See git-config() for details.

执行命令:
$ git config branch.master.remote origin
$ git config branch.master.merge refs/heads/master  

解决问题 

git push origin master、git pull出现如下错误的更多相关文章

  1. git push origin master 上传失败

    http://blog.csdn.net/llf369477769/article/details/51917557 按照网上教程用git把项目上传到github,但是在最后一步git push or ...

  2. git push origin master出错:error: failed to push some refs to

    1.输入git push origin master 出错:error: failed to push some refs to 那是因为本地没有update到最新版本的项目(git上有README. ...

  3. git push origin master错误

    以下错误是因为远程有的文件,本地没有,故而无法push文件到远程 $ git push origin master To git@github.com:AntonioSu/learngitWindow ...

  4. git push origin master和git push有什么区别?

    1.master是主分支,还可以建一些其他的分支用于开发.2.git push origin master的意思就是上传本地当前分支代码到master分支.git push是上传本地所有分支代码到远程 ...

  5. git push origin master:master

    $git push origin master:master (在local repository中找到名字为master的branch,使用它去更新remote repository下名字为mast ...

  6. 解决Git - git push origin master 报错

    关注我,每天都有优质技术文章推送,工作,学习累了的时候放松一下自己. 欢迎大家关注我的微信公众号:「醉翁猫咪」 原因:github仓库中没有README.md文件 解决如下: 重新输入git push ...

  7. git push origin与git push -u origin master的区别

    $ git push origin 上面命令表示,将当前分支推送到origin主机的对应分支. 如果当前分支只有一个追踪分支,那么主机名都可以省略. $ git push 如果当前分支与多个主机存在追 ...

  8. git merge origin master git merge origin/master区别

    git merge origin master //将origin merge 到 master 上 git merge origin/master //将origin上的master分支 merge ...

  9. Git - git push origin master 报错的解决方法

    亲测实用,转载保存,原文地址:https://blog.csdn.net/kangvcar/article/details/72773904 错误提示如下: [root@linux1 php]# gi ...

随机推荐

  1. vs调试windows mobile程序时布署时间太长的解决办法

    vs调试windows mobile程序时布署时间太长的解决办法 1.VS平台上,选工具-选项-项目和解决方案-MS BUILD项目生成输出详细信息中选择“诊断”,目的是在调试窗口中看出哪个过程编译的 ...

  2. js事件冒泡和事件委托

    js事件冒泡 js所谓的事件冒泡就是子级元素的某个事件被触发,它的上级元素的该事件也被递归执行 html: <ul class="clearfix" data-type=&q ...

  3. 客户调用COM流程

    参考:COM技术内幕 DllGetClassObjecthttps://msdn.microsoft.com/en-us/library/windows/desktop/ms680760.aspx   ...

  4. Basic MSI silent install

    Articles and post about silent install for Basic MSI, InstallScript, InstallScript MSI: Silent-mode ...

  5. update语句

    [update cicm.cicmodt0702 set msgbody = :1 where msgid between :2 and :3         ] [update cicm.cicmo ...

  6. OpenJudge/Poj 1226 Substrings

    1.链接地址: http://bailian.openjudge.cn/practice/1226/ http://poj.org/problem?id=1226 2.题目: 总时间限制: 1000m ...

  7. CentOS6.4 安装JDK

    1.下载JDK,这里用的是jdk-7u65-linux-x64.tar.gz,请到官网上下载. 2.清除默认的JDK,yum remove java 3.解压文件 tar -xzf jdk-7u65- ...

  8. CDH安装Hadoop

    一.安装CDH-manager 1.关闭selinux 修改/etc/selinux/config 文件 将SELINUX=enforcing改为SELINUX=disabled 重启机器即可   2 ...

  9. 响应式布局中重要的meta标签设置.适用于手机浏览器兼容性设置

    <!-- #手机浏览器兼容性设置 -->    <meta content="application/xhtml+xml;charset=UTF-8" http- ...

  10. ServiceController组件控制计算机服务

    private void Form1_Load(object sender, EventArgs e) { //下面的示例使用 ServiceController 类检查IIS服务是否已停止.如果该服 ...