git 配置中几个容易忽视的问题
来源:互联网 发布:xshell传文件到linux 编辑:程序博客网 时间:2024/05/16 19:37
<pre name="code" class="cpp"><span style="font-family: Arial, Helvetica, sans-serif; background-color: rgb(255, 255, 255);">这段时间用gitosis搭建了git server,在使用过程中还有一些问题,这些问题的解决也是来自网络,就在这里整理一下。</span>
<span style="font-family: Arial, Helvetica, sans-serif; background-color: rgb(255, 255, 255);">1 在客户端向服务端去push的时候出现</span>insufficient permission for adding an object to repository database .git/objects
<span style="font-family: Arial, Helvetica, sans-serif; background-color: rgb(255, 255, 255);">这个是因为权限有问题,比如在服务端创建工程时用的用户名是root,但是在clone时用的</span><span style="font-family: Arial, Helvetica, sans-serif; background-color: rgb(255, 255, 255);">git clone git@xxxx:YYY.git</span>
<span style="font-family: Arial, Helvetica, sans-serif; background-color: rgb(255, 255, 255);">修改后push用 git push origin master. 这样就出问题了,其实只要在服务端将工程的所有者修改即可</span>
<span style="font-family:Arial, Helvetica, sans-serif;"><span style="background-color: rgb(255, 255, 255);">方法如下,在服务端进入到git工程的父目录,用ls -la查看工程的所有者</span></span>
<span style="font-family:Arial, Helvetica, sans-serif;"><span style="background-color: rgb(255, 255, 255);">接着用 <span style="color: rgb(51, 51, 51); font-family: Georgia; font-size: 14px; letter-spacing: 1px; line-height: 20px;">sudo chown -R git:git YYY.git 即可</span></span></span>
<span style="font-family:Arial, Helvetica, sans-serif;"><span style="background-color: rgb(255, 255, 255);"><span style="color: rgb(51, 51, 51); font-family: Georgia; font-size: 14px; letter-spacing: 1px; line-height: 20px;"></span></span></span>
<span style="font-family:Arial, Helvetica, sans-serif;"><span style="background-color: rgb(255, 255, 255);"><span style="color: rgb(51, 51, 51); font-family: Georgia; font-size: 14px; letter-spacing: 1px; line-height: 20px;"></span></span></span>
<span style="font-family:Arial, Helvetica, sans-serif;"><span style="background-color: rgb(255, 255, 255);"><span style="color: rgb(51, 51, 51); font-family: Georgia; font-size: 14px; letter-spacing: 1px; line-height: 20px;"></span></span></span>
<span style="font-family:Arial, Helvetica, sans-serif;"><span style="background-color: rgb(255, 255, 255);"><span style="color: rgb(51, 51, 51); font-family: Georgia; letter-spacing: 1px; line-height: 20px;"><span style="font-size: 14px;">2 在客户端push时出现</span></span></span></span><h1 itemprop="name" style="margin: 0px 0px 0.5em; padding: 0px; border: 0px; border-image-source: initial; border-image-slice: initial; border-image-width: initial; border-image-outset: initial; border-image-repeat: initial; line-height: 1.3; color: rgb(34, 34, 34); font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;"><a target=_blank href="http://stackoverflow.com/questions/2816369/git-push-error-remote-rejected-master-master-branch-is-currently-checked" class="question-hyperlink" style="margin: 0px 0px 0.5em; padding: 0px; border: 0px; border-image-source: initial; border-image-slice: initial; border-image-width: initial; border-image-outset: initial; border-image-repeat: initial; cursor: pointer; color: rgb(34, 34, 34); text-decoration: none; line-height: 1.35; font-weight: normal;"><span style="font-size:14px;">Git push error '[remote rejected] master -> master (branch is currently checked out)'</span></a></h1>
<span style="font-family: Arial, Helvetica, sans-serif; background-color: rgb(255, 255, 255);">这个是因为在工程初始化时方法不对,我的工程是在服务端创建的,也就是俗称的Remote(进入到工程中使用git init)</span>
<span style="font-family: Arial, Helvetica, sans-serif; background-color: rgb(255, 255, 255);">这里只要再次进入到服务端的工程下,运行</span><span style="font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, sans-serif; white-space: inherit; color: rgb(34, 34, 34); font-size: 13px; background-color: rgb(238, 238, 238);">git config --bool core.bare true 即可解决问题。</span>
0 0
- git 配置中几个容易忽视的问题
- MyISAM几个容易忽视的配置选项
- MyISAM几个容易忽视的配置选项
- java 学习中容易忽视的问题!!
- java 学习中容易忽视的问题!!
- java 学习中容易忽视的问题!!
- java中一个容易忽视的问题
- js基本语法中容易忽视的几个地方
- 几个容易忽视的java编程细节
- JS干货--几个容易忽视的知识点
- [转]网页制作中一些容易被忽视的问题
- PHP中容易被忽视的数据类型问题
- js中容易被忽视的事件问题总结
- App产品设计中,最容易忽视的问题有哪些?
- 一个容易忽视的存储过程问题
- 容易忽视的oracle函数问题--数据类型
- 问题的本身往往容易被忽视
- calendar设置月份容易忽视的问题
- 被jar包冲突害惨了
- 程序员如何快速准备面试中的算法
- iOS 的MVC设计模式
- CSS中一个冒号和两个冒号有什么区别
- LBP算法的研究
- git 配置中几个容易忽视的问题
- Shell脚本有几种运行方式,如何使用?
- 如何在Unity3d中实现MAYA的BlendShape
- const关键字用法
- Java中基础知识点(一)
- iOS开发 - UIView 属性和方法
- javascript
- 读懂BOM和DOM
- 第二个Activety中webview响应代码