English 中文(简体)
不知怎么的,我得到了一个非巴雷 储存库 在 gitisis?
原标题:I got a non-bare repository in gitosis somehow?
  • 时间:2012-05-24 17:17:57
  •  标签:
  • git
  • gitosis

我试图推到一个 Git 仓库, 该仓库由服务器上的 gitsis 管理。 当我推时, 我得到这个错误 :

william@utapau:~/lyre$ git push
Enter passphrase for key  /home/william/.ssh/id_dsa : 
Counting objects: 9, done.
Compressing objects: 100% (5/5), done.
Writing objects: 100% (5/5), 705 bytes, done.
Total 5 (delta 4), reused 0 (delta 0)
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 r:lyre
 ! [remote rejected] master -> master (branch is currently checked out)
error: failed to push some refs to  r:lyre 

我发现了这个问题:

< a href=" "https://stackoverflow.com/q/28/ q/2816369/403554" > Git 推力错误 [远程拒绝] 主人 - & gt; 主人( 正在检查分支)

并在那里尝试了答案, 没有运气。 远程仓库没有 < code>. git 文件夹, 因为它是用 gitsis 设置的。 不应该有工作树或检查里面的分支 。

仓库文件夹结构看起来像 :

william@sirius:/home/git/repositories/lyre.git$ ls -hal
total 40K
drwxr-xr-x   7 git users 4.0K May 24 12:58 .
drwxr-xr-x   5 git users 4.0K May  4  2011 ..
drwxr-xr-x   2 git users 4.0K May  4  2011 branches
-rw-rw-r--   1 git users   66 May 24 12:58 config
-rw-r--r--   1 git users   73 May  4  2011 description
-rw-r--r--   1 git users   23 May  4  2011 HEAD
drwxr-xr-x   2 git users 4.0K May  4  2011 hooks
drwxr-xr-x   2 git users 4.0K May  4  2011 info
drwxr-xr-x 163 git users 4.0K Apr 26 15:26 objects
drwxr-xr-x   4 git users 4.0K May  4  2011 refs

william@sirius:/home/git/repositories/lyre.git$ cd branches/
william@sirius:/home/git/repositories/lyre.git/branches$ ls -hal
total 8.0K
drwxr-xr-x 2 git users 4.0K May  4  2011 .
drwxr-xr-x 7 git users 4.0K May 24 12:58 ..

我怎样才能摆脱困境 赶到仓库?

最佳回答

PEBCAK。 事实证明我没有克隆我以为是我克隆的存储库。 我试图推到一个非空的存储库。

在远程服务器上, gitosis 储存库位于/ home/git/respositories/lyre.git/ ,我还有一个克隆在/ home/william/lyre/

在我本地的工作站上,我设置了 类似:

host r
  user william

当我克隆存储库时,我用git clicken r:lyre 进行克隆,无意中克隆了克隆,而不是 gitsois repo 。 当我试图推进时,我确实在向非巴雷复制。

我将 更改为 :

host r
  user git

我的问题都解决了 这都是错认

问题回答

暂无回答




相关问题
git confusion - cloning a repo is returning a past version

Im having some confusion with my git usage. I cloned a repo from one comp to the other, and the new clone is the state of the original that was active some time ago. So its cloning a past version. ...

Appropriate strategy for tagging and hotfixing with git

I was wondering if the strategy I m using for tagging and hotfixing tags (which then I use for deploying rails applications) with git is appropriate. For tagging I just tag a commit of the master ...

Tips on upgrading CVS to git/hg?

We still use CVS, I use git and hg for my personal use though I m still a novice at both, but I realize they re much more modern and better, faster, distributed, etc. It s just everyone is so ...

Using Git in a TFS shop

Using Git at home has spoiled me - I now find using TFS at work to be a bit of a drag and want to explore the possibility of using Git locally and syncing somehow with TFS. I figure there are a few ...