2011-08-04 176 views
0

我是新来的混帐,我有问题 我在推送数据在我的混帐系统有问题。 我安装了Git和gitolite但是当我打电话:“混帐推起源大师”它给了我这个错误:centos5 git共享文件夹

Counting objects: 12, done. 
Compressing objects: 100% (9/9), done. 
Writing objects: 100% (12/12), 1.47 KiB, done. 
Total 12 (delta 1), reused 5 (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 [email protected]:gitolite-admin 
! [remote rejected] master -> master (branch is currently checked out) 
error: failed to push some refs to '[email protected]:gitolite-admin' 

我跟着这个教程安装gitolite:但gitolink 一切都按我应该是在最后步。当我执行命令,我可悲得到这个错误

任何人都可以告诉我该怎么办或如何解决这个问题? 已经thried: 混帐配置--bool core.bare真正 改变分支(这样(主)不使用)

+0

可能重复[无法推入到git存储库](http://stackoverflow.com/questions/3221859/cannot-push-into-git-repository) –

回答

0

最根本的问题是,你要推到一个“无-bare“git存储库。虽然这是可能的,但很多文档和书籍都没有清楚表明这不被推荐。

因此而Git是一个分散/众高手SCM,在实践中,你往往有什么“大师”或从克隆,推动,并作为“规范”,“中央”资源库回购和工作回购(例如在您的笔记本电脑上),您从“主”中克隆出来,您将改为,并从

server$ cd ; mkdir git 
server$ git clone --bare /home/user/foo /home/user/git/foo.git 

一旦你做到了这一点,你就可以从你的笔记本电脑推:这些“大师”库中,应当与--bare创建

laptop$ cd foo 
laptop$ git remote -v 
laptop$ origin [email protected]:/home/user/git/foo.git (fetch) 
laptop$ origin [email protected]:/home/user/git/foo.git (push) 
laptop$ git push origin master 

你也可以做服务器:

git config --global receive.denyCurrentBranch "ignore" 

但我不会这样做,直到你更好地理解git如何工作。

+0

我得到的错误起源不是一个命令 当我跳过以原点开始的行(转到git push) 我检索错误:origin似乎不是git存储库 – thanksalot