2014-02-23 123 views
0

我正在试图达到什么---作为git存储库和工作副本的本地目录

我对git知之甚少并试图学习它。我的服务器中没有安装git。

因此,我试图在我的系统中创建一个文件夹(Git Repos文件夹),该文件夹将充当存储库的目录。 (像GitHub中创建的存储库)和另一个文件夹(Git克隆文件夹),我可以在其中克隆回购并对其进行处理(如本地克隆的github存储库)。

我希望能够在的Git回购文件夹承诺,并从任何存储库中的Git克隆推夹到相应的存储库。

我曾尝试 -

我创建了一个名为praveenpuglia.com回购内部的Git回购文件夹git init使它一个Git仓库。

接下来,我克隆内的Git克隆回购为praveenpuglia.com文件夹使用git clone D:/Git Repos Folder/praveenpuglia.com

我把自述文件,上演并提交它。

当我试图推动修改到主,我得到这些错误

Pushing to D:/Git Repos Folder/praveenpuglia.com 
remote: error: refusing to update checked out branch: refs/heads/master[K 
remote: error: By default, updating the current branch in a non-bare repository[K 
remote: error: is denied, because it will make the index and work tree inconsistent[K 
remote: error: with what you pushed, and will require 'git reset --hard' to match[K 
remote: error: the work tree to HEAD.[K 
remote: error: [K 
remote: error: You can set 'receive.denyCurrentBranch' configuration variable to[K 
remote: error: 'ignore' or 'warn' in the remote repository to allow pushing into[K 
remote: error: its current branch; however, this is not recommended unless you[K 
remote: error: arranged to update its work tree to match what you pushed in some[K 
remote: error: other way.[K 
remote: error: [K 
remote: error: To squelch this message and still keep the default behaviour, set[K 
remote: error: 'receive.denyCurrentBranch' configuration variable to 'refuse'.[K 
To D:/Git Repos Folder/praveenpuglia.com 
! [remote rejected] master -> master (branch is currently checked out) 
error: failed to push some refs to D:/Git Repos Folder/praveenpuglia.com' 

什么我做错了,我该如何设置?我在这里尝试了几个可用的答案,但无法理解。

+0

阅读这本书,它会帮助:) http://git-scm.com/book – user376507

回答

1

如果要推送到远程存储库,必须将其创建为裸存储库。 您可以将远程仓库裸露的:

git config --bool core.bare true 
+0

我这样做,并从克隆推。它被推了。但推送的文件不会反映在** D:/ Git Repos Folder/praveenpuglia.com **文件夹中。 –

+0

尝试检查远程存储库上的'git log'。你看到你所有的提交? – demas

+0

日志显示提交,尽管它不显示自述文件。 作者:Praveen Puglia <[email protected]> 日期:Sun Feb 23 20:38:48 2014 +0530 最初提交。自述文件添加了。 –