Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1251148
  • 博文数量: 168
  • 博客积分: 3483
  • 博客等级: 中校
  • 技术积分: 1696
  • 用 户 组: 普通用户
  • 注册时间: 2006-02-06 13:17
文章分类

全部博文(168)

文章存档

2015年(6)

2014年(9)

2013年(47)

2012年(11)

2011年(13)

2010年(18)

2009年(11)

2008年(42)

2007年(11)

分类: 项目管理

2013-01-21 16:41:59

1-- clone分支,修改文件本地commit后, push回原分支失败,报错:

  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)
  error: failed to push some refs to 'git+ssh://hap@192.168.1.2/media/LINUXDATA/working'


  参照如下链接,目标repo中执行 $ git config 'receive.denyCurrentBranch' warn 后OK

  http://stackoverflow.com/questions/2816369/git-push-error-remote-rejected-master-master-branch-is-currently-checked


2-- 新增文件add commit后,push回原分支失败,报错:

  Counting objects: 20, done.
  Delta compression using up to 24 threads.
  Compressing objects: 100% (11/11), done.
  Writing objects: 100% (11/11), 1.30 KiB, done.
  Total 11 (delta 5), reused 0 (delta 0)
  error: insufficient permission for adding an object to repository database ./objects


  参照如下链接,查看原repo .git目录权限,发现.git/object/没有group写权限导致;执行 $ sudo chmod g+w -R .git/object 后OK

  

 

3-- git clone/git clone --bare/git clone --mirror 区别

   



4-- does not appear to be a git repository

     这种问题,权限问题居多,看看整个repo目录 全路径上面用户、组权权限,是否允许访问

阅读(23233) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~