Git共享存储库没有';我不能像';共享';

Git共享存储库没有';我不能像';共享';,git,push,shared,Git,Push,Shared,首先很抱歉,但我确实搜索了一下,没有找到任何对我有帮助的东西 在我的工作中,我在测试服务器中创建了一个git存储库,如下所示: cd home/REPO git init 然后我在本地计算机中克隆(空): cd /home/workingFolder git clone ssh://me@ip:port/home/REPO 一切都好。 然后我复制了一些已经存在的文件(.doc),然后: git add . 提交并推送到服务器REPO git commit git push 然后,我的朋友

首先很抱歉,但我确实搜索了一下,没有找到任何对我有帮助的东西

在我的工作中,我在测试服务器中创建了一个git存储库,如下所示:

cd home/REPO
git init
然后我在本地计算机中克隆(空):

cd /home/workingFolder
git clone ssh://me@ip:port/home/REPO
一切都好。 然后我复制了一些已经存在的文件(.doc),然后:

git add .
提交并推送到服务器REPO

git commit
git push
然后,我的朋友将回购协议克隆到他的机器中并获取文件

现在我包含了另一个文件,git添加、提交和推送都没有问题

当我的朋友试图拉或拿东西时,什么也没发生


也许我不明白Git应该如何工作,但是我如何在同事之间共享文件呢? 这是REPO服务器中的配置文件

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

就个人而言,我会尝试使用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推送原始主机
    (推送更改)

如果必须的话,您可能可以在没有github的情况下使用它。

就个人而言,我会尝试使用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推送原始主机
    (推送更改)

如果必须的话,您可能可以在没有github的情况下使用它。

也许我不明白Git应该如何工作

这就是问题所在


解决了将中央存储库创建为--bare的问题。裸露表示此存储库不包含项目的任何实际文件,只包含有关快照的信息

也许我不明白Git应该如何工作

这就是问题所在


解决了将中央存储库创建为--bare的问题。裸露表示此存储库不包含项目的任何实际文件,只包含有关快照的信息

更有趣的是您的.git/config。你能把它寄出去吗?你的同事是如何克隆回购协议的?你是否添加/修改了“bare”和“sharedRepository”值?更有趣的是你的.git/config。你能把它寄出去吗?你的同事是如何克隆回购协议的?你是否添加/修改了“裸”和“共享”值?github.com很棒。但在工作环境中,如果您想保持存储库的私有性,则必须升级到付费帐户。我还要检查是否可以将专有代码导出到第三方服务器。有些公司不喜欢这样。权限有问题。我改变了回购协议的分组,现在一切正常。无论如何谢谢你的帮助。github.com很棒。但在工作环境中,如果您想保持存储库的私有性,则必须升级到付费帐户。我还要检查是否可以将专有代码导出到第三方服务器。有些公司不喜欢这样。权限有问题。我改变了回购协议的分组,现在一切正常。无论如何,谢谢你的帮助。