git默认拒绝了push操作
来源:互联网 发布:sqlserver 商业智能 编辑:程序博客网 时间:2024/06/11 19:32
在使用Git Push代码到数据仓库时,提示如下错误:
[remote rejected] master -> master (branch is currently checked out)
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.1.X:/var/git.server/.../web
! [remote rejected] master -> master (branch is currently checked out)
error: failed to push some refs to 'git@192.168.1.X:/var/git.server/.../web'
这是由于git默认拒绝了push操作,需要进行设置,修改.git/config添加如下代码:
[receive]
denyCurrentBranch = ignore
在初始化远程仓库时最好使用 git --bare init 而不要使用:git init
如果使用了git init初始化,则远程仓库的目录下,也包含work tree,当本地仓库向远程仓库push时, 如果远程仓库正在push的分支上(如果当时不在push的分支,就没有问题), 那么push后的结果不会反应在work tree上, 也即在远程仓库的目录下对应的文件还是之前的内容,必须得使用git reset --hard才能看到push后的内容.
- git默认拒绝了push操作
- git push拒绝更新
- git push提交时报错,拒绝提交
- git push被拒绝的处理方式
- git push相关操作
- git push 操作
- git push常见操作
- 终于要git push了
- [git] git2.0 默认的push模式
- Git push与pull的默认行为
- Git配置默认pull、push地址
- Git push与pull的默认行为
- Git push与pull的默认行为
- Git push与pull的默认行为
- Git push与pull的默认行为
- Git push与pull的默认行为
- git push和git pull的默认行为
- git 撤销已经push上去的操作
- 利用织梦dedecms单页功能制作Sitemap.xml地图
- 日经社説 20150122 理想論のオバマ教書で米政治は動くか
- scrum training
- linux 修改文件夹及文件拥有者与群组(1)
- SDUT 1595 选夫婿2
- git默认拒绝了push操作
- 深入 Lucene 索引机制-学习笔记1
- 社説 20150122 訪日客急増 観光立国へ弾みをつけたい
- 45分钟会议:节省时间和钱!
- Android的webview加载本地html、assert内html和网络URL&&& JS与移动端webview的相互交互
- 【。。。】
- 社説 20150122 米一般教書演説 対テロで一層の指導力発揮を
- 楔文
- Servlet多线程安全问题