2014-01-14 83 views
6

我很新手谈到GIT。在这里我试图解释我的错误情况。请以确切的命令帮助我。! [远程拒绝]主 - >主(分支目前检出)错误git

我必须在GIT远程位置清空存储库。我只有权限克隆它们并将其更改推送给它们。我无权直接访问GIT Remote。 回购是。 funder-sceduler.git和funder-request.git。 详细为他们的路径:

  1. SSH://[email protected]/apps/git/web-platform/dotcms/modules/funder-request.git
  2. SSH:// [email protected]/apps/git/web-platform/dotcms/modules/funder-scheduler.git

现在我在本地克隆出资人,scheduler.git。我添加了我的更改。然后我做了一个GIT提交。 然后git push origin master。 它工作正常。

但是,当我的资助者,request.git做同样的,运行命令“混帐推起源硕士后其抛出以下错误:

>$ git push origin master 
>Enter passphrase for key '/u/.ssh/id_rsa': 
>Counting objects: 81, done. 
>Compressing objects: 100% (61/61), done. 
>Writing objects: 100% (81/81), 215.86 KiB | 126.00 KiB/s, done. 
>Total 81 (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 inconsist 
ent 
>remote: error: with what you pushed, and will require 'git reset --hard' to matc 
h 
>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 ssh://[email protected]/apps/git/web-platform/dotcms/modules/funder- 
request.git 
! [remote rejected] master -> master (branch is currently checked out) 
error: failed to push some refs to 'ssh://[email protected]/apps/git/we 
b-platform/dotcms/modules/funder-request.git' 

请求帮助我准确的命令来解决这个。 我不理解理论上的解释,我很抱歉

回答

4

看起来funder-request.git不是裸露的回购,这意味着它有一个工作树(来自结算分支的文件)。

请参阅“all about "bare" repos -- what, why, and how to fix a non-bare push”更多:
使用非裸露的回购协议需要与混帐回购协议本身的内容制作工作树的内容不同步的风险。

您需要联系该服务器的管理员,并将其转换为裸露的回购。
请参阅“How to convert a git repository from normal to bare ?”。

+0

谢谢冯,它看起来很完美。 – user3052178

相关问题