git版本管理工具push失败解决方案参考
git clone xxx@xx 版本后,edit某文件,commit之后,点push,提示报错。
可能有以下原因:
1、权限不够,远程仓库的文件夹(比如/home/git)下面的文件所属用户非git用户,而默认的文件权限通常是644,那么当你用非git用户push的时候,肯定是权限不够的。
解决方法:进入远程仓库的上一级,查看git目录下所有文件的权限,比如:
cd /home/git ls -al
更改git目下所有文件目录的文件主为git:
chown -R git.git /home/git/*
2、如果报错提示如下:
git push
hap@192.168.1.2's password:
Counting objects: 21, done.
Compressing objects: 100% (11/11), done.
Writing objects: 100% (11/11), 1010 bytes, done.
Total 11 (delta 9), reused 0 (delta 0)
error: refusing to update checked out branch: refs/heads/master
error: By default, updating the current branch in a non-bare repository
error: is denied, because it will make the index and work tree inconsistent
error: with what you pushed, and will require 'git reset --hard' to match
error: the work tree to HEAD.
error:
error: You can set 'receive.denyCurrentBranch' configuration variable to
error: 'ignore' or 'warn' in the remote repository to allow pushing into
error: its current branch; however, this is not recommended unless you
error: arranged to update its work tree to match what you pushed in some
error: other way.
error:
error: To squelch this message and still keep the default behaviour, set
error: 'receive.denyCurrentBranch' configuration variable to 'refuse'.
To git+ssh://hap@192.168.1.2/media/LINUXDATA/working
! [remote rejected] master -> master (branch is currently checked out)
则进入远程仓库
cd /home/git/ssm.git
再执行如下命令
git config 'receive.denyCurrentBranch' warn
转载于:https://blog.51cto.com/stoffsky/1656000
git版本管理工具push失败解决方案参考相关推荐
- Git——版本管理工具(一)
Git 是一个分布式版本控制工具,它的作者 Linus Torvalds 是这样给我们介绍 Git -- The stupid content tracker(傻瓜式的内容跟踪器) 1. Git 背 ...
- Git 版本管理工具(一)
Git 是一个分布式版本控制工具,它的作者 Linus Torvalds 是这样给我们介绍 Git -- The stupid content tracker(傻瓜式的内容跟踪器) 1. Git 背 ...
- git版本管理工具学习
1.git版本管理工具作用:a.备份b.像时光机一样回到过去,防止错误删除c.多端共享d,独当一面和团队协作 2早起的版本管理工具:CVS,集中式管理工具 github是git的一个托管网站:GitH ...
- Git 版本管理工具命令速查
转自:http://www.jb51.net/article/55442.htm 一. Git 常用命令速查 git branch 查看本地所有分支 git status 查看当前状态 git co ...
- Git版本管理工具使用详细介绍
一.引言 跟你们吐槽一下,最近小编的工作制度也改成996,怎么说? 是好是坏呢? 网上很多小伙伴也在吐槽,刚开始小编也是挺反感的,毕竟之前周末一些坚持的习惯,因此都需要改变. 既然公司选择了996,我 ...
- Git版本管理工具超详细(下载、安装、远程仓库的搭建、git指令)
目录 01_Git概述 02_GIT相关概念(掌握) 03_Git下载与安装 04_Git本地操作-初始化工作区 05_Git本地操作-add与commit 06_Git本地操作-差异比较 07_Gi ...
- Git版本管理工具的使用
一.下载安装 windows: https://git-for-windows.github.io/,下载文件后一路next linux: # ubuntu,debian# $ sudo apt-ge ...
- git版本管理工具用法介绍
1. 概要 Git 是 Linux 发明者 Linus 开发的一款新时代的版本控制系统,对于软件开发领域来说版本控制是最重要的一环,而 Git 毫无疑问是当下最流行.最好用的版本控制系统. 2. ...
- Git版本管理工具常用命令整理和说明
作者:心叶 时间:2018-04-20 23:20 工作区:就是你在电脑里能看到的目录. 暂存区:英文叫stage, 或index.一般存放在 ".git目录下" 下的index文 ...
最新文章
- Linux下得到显示屏参数的方法
- 【CSS练习】常用的CSS字段
- 【报错笔记】sturts2程序运行出现错误:Struts has detected an unhandled exception
- 非常不错的文章,囊括啦高性能、高可用的分布式架构体系所有名词
- 程序人生:程序员成熟的标志
- JS数组的需要注意的问题
- 08-09 性能测试--CPU分析
- Apache Log4j2远程JNDI代码执行漏洞修复
- 如何用 Bash 创建一个二进制发布包
- 有哪些不讲武德的国外计算机学习资源?
- python flask_Python Flask框架详解
- Atitit 数据查询法 目录 1. 数据查询语言QL (推荐)	1 1.1. Sql	1 1.2. 对象查询语言(OQL)	1 1.3. Atitit QL查询语言总结Jpql Ongl
- win7 iis安装教程
- win7 增加Internet时间服务器
- 开关电源的电感选择和布局布线
- 自己动手,解决微信投票提示“投票失败”问题
- 08s01 mysql_MYSQL 08S01错误怎么处理
- ae制h5文字动画_绝对干货!H5动画制作方法全揭秘
- SLCP验厂辅导,SLCP验证员必须遵守验证协议中的验证规则以确保数据的质量和完整性
- 有介质的高斯定理详细证明(电偶极子模型)以及例题讲解
热门文章
- python程序实例教程基础-Python简单基础小程序的实例代码
- python3菜鸟教程中文-Python3 字符串
- 图像的评价指标之SSMI——结构相似性
- LeetCode 495. Teemo Attacking
- LeetCode Reverse Vowels of a String(字符串中元音字符反转)
- libevent中事件的添加与删除
- setDAta 字符串拼接
- Linux Centos6.5 SVN服务器搭建 以及客户端安装
- 算法笔记_188:历届试题 危险系数(Java)
- 【BZOJ】1012: [JSOI2008]最大数maxnumber 树状数组求区间最值