git 提交代码remote: error:updating the current branch in a non-bare repository is denied
来源:互联网 发布:nrf24l01与单片机连接 编辑:程序博客网 时间:2024/05/19 04:54
问题:
开发机提交代码到远程仓库时,出错如下错误:
$ git push origin masterCounting objects: 3, done.Delta compression using up to 4 threads.Compressing objects: 100% (2/2), done.Writing objects: 100% (3/3), 267 bytes | 0 bytes/s, done.Total 3 (delta 1), reused 0 (delta 0)remote: error: refusing to update checked out branch: refs/heads/masterremote: error: By default, updating the current branch in a non-bare repositoryremote: error: is denied, because it will make the index and work tree inconsistentremote: error: with what you pushed, and will require 'git reset --hard' to matchremote: error: the work tree to HEAD.remote: error:remote: error: You can set 'receive.denyCurrentBranch' configuration variable toremote: error: 'ignore' or 'warn' in the remote repository to allow pushing intoremote: error: its current branch; however, this is not recommended unless youremote: error: arranged to update its work tree to match what you pushed in someremote: error: other way.remote: error:remote: error: To squelch this message and still keep the default behaviour, setremote: error: 'receive.denyCurrentBranch' configuration variable to 'refuse'.To git@192.168.12.70:/data/orange ! [remote rejected] master -> master (branch is currently checked out)error: failed to push some refs to 'git@192.168.12.70:/data/orange'
解决办法:
在服务器端仓库目录下
$ cd /data/orange$ git config receive.denyCurrentBranch warn
更好的办法:
error信息中已经给出提示:
“By default, updating the current branch in a non-bare repository is denied,”
服务器上配置代码仓库时,将代码库初始化为裸仓库,即使用命令:
$ git init --bare
这样,其他机器提交代码就不会有问题。
阅读全文
0 0
- git 提交代码remote: error:updating the current branch in a non-bare repository is denied
- Bare and non-bare repository of Git
- 【git】updates were rejected because the tip of your current branch is behind its remote counterpart
- Git- [!remote rejected]:refusing to delete the current branch
- git error:Updates were rejected because the tip of your current branch is behind
- (git问题)解决The current branch is not configured for pull No value for key remote.origin
- git 解决The current branch is not configured for pull No value for key branch.master.merge found in co
- How to delete the remote branch in git
- How to Push a New Local Branch to a Remote Git Repository
- updates were rejected because the tip of your current branch is behind its remote counterpart
- Updates were rejected because the tip of your current branch is behind its remote counterpart.
- Updates were rejected because the tip of your current branch is behindhint: its remote counterpart.
- svn提交代码报错:A conflict in the working copy obstructs the current operation,解决办法
- eclipse git报错git The current branch is not configured for pull No value for key branch.master.merge
- Is it possible to alias a branch in Git?
- PULL A NEW BRANCH FROM A REMOTE REPOSITORY
- eclipse中的git pull时出现 “the current branch is not configured.....”
- git pull出现There is no tracking information for the current branch
- 确实该往深处钻钻了
- 模板--并查集
- Linux运维学习笔记之一:运维的原则和学习方法
- 简单实现双链表---学习
- 开源车牌识别项目,OpenALPR
- git 提交代码remote: error:updating the current branch in a non-bare repository is denied
- Map-Reduce和Spark
- keepalived对lftp的控制
- USB设备插入和拔出的波形
- Apache 虚拟功能- 同一台电脑运行两个以上的网站
- 高效学习之全脑模型
- quartz基本使用
- 解决axios IE11 Promise对象未定义
- Springboot学习-使用AOP统一处理Web请求日志(六)