Git共享存储库不能作为'共享'

问题描述:

首先抱歉,但我没有搜索到任何帮助我的东西。Git共享存储库不能作为'共享'

我已经在我的工作创造了测试服务器一个Git仓库,像这样:

cd home/REPO 
git init 

然后我在本地机器克隆(空):

cd /home/workingFolder 
git clone ssh://[email protected]:port/home/REPO 

样样精。 然后我复制已经存在,然后一些文件(.DOC):

git add . 

和COMMITED并推送到服务器REPO

git commit 
git push 

我的朋友的话,克隆回购为他的机器,并得到文件。

现在我包括另一个文件,添加的git,COMMITED并没有问题推。

当我的朋友试图拉取或不发生任何事情。

也许我不明白Git是如何想工作,但我怎么能分享我的同事之间的文件吗? 这是在REPO服务器

[core] 
    repositoryformatversion = 0 
    filemode = true 
    bare = true 
    logallrefupdates = true 
    sharedRepository = true 
[push] 
    default = current 
+0

更有趣的是你的.git/config。你可以发布吗?你的同事如何克隆回购? – fork0 2012-08-08 20:35:57

+0

您是否添加/修改了“bare”和“sharedRepository”值? – 2012-08-08 20:36:07

也许我不明白Git是如何想的工作...

这是问题。

解决了创建中央存储库为--bare的问题。裸露的意思是这个存储库不包含项目的任何实际文件,只包含关于快照的信息。

个人而言,我只想尝试使用GitHub上的配置文件。在这种情况下,我会做到这一点:

$ mkdir my_git_test 
$ cd my_git_test/ 
$ do the github stuff 

Create the repository in github on the github site (free). 
Then use the 'copy' link/button 

Then, in a terminal do: 
$ git clone [paste], e.g. git clone https://github.com/durrantm/my_git_test.git 

$ cd my_git_test 

$ touch aaa # as a test 
(or move your existing files into the `my_git_test` directory) 

$ git status # Make sure there are changes showing 

$ git add . # Add your changes to your repository. 

$ git commit -m "One Change" 

$ git push origin master 

Your friend can then do: 
(github) Use the 'copy' link/button 
Then, in a terminal locally, do 
$ git clone [paste], e.g. git clone https://github.com/durrantm/my_git_test.git 

展望未来,使后(本地)改变了你应遵循的程序:

  • 使局部的变化。
  • git pull origin master(看看是否有任何改变)
  • 解决任何冲突(如果有任何冲突,你会看到适当的消息)。
  • git push origin master(把你的变化)

你或许可以适应这个没有GitHub的工作,如果你真的不得不这样做。

+0

github.com很棒。但在工作情况下,如果要保持资料库的私密性,则必须升级到付费帐户。我还会检查是否可以将专有代码导出到第三方服务器。有些公司不喜欢那样。 – 2012-08-08 20:51:09

+0

权限问题。我改变了REPO小组,现在工作正常。无论如何,感谢您的帮助。 – user1585759 2012-08-09 14:13:11