首页 > 解决方案 > git-clone local 从 git-only 用户到普通用户(debian) - git-push 需要很长时间/没有完成

问题描述

最近我启动了自己的 git 服务器,现在基本上可以正常工作。

情况:在我的服务器上有像gituser1这样的用户。前者应该管理/存储我的 git 项目并让它们在本地和远程访问。后者只是我用来运行电报机器人或其他东西的普通用户。通常我为用户git创建一个裸 git 存储库,project1.git并且在用户user1的目录中已经有子目录project1,我通过git init.

按照ProGit 之类的说明,我从's 目录链接project1project1.git这样的user1 :project1

git remote add origin ssh://git@hostname:1234/pathToGituserDirectory/project1.git 

在此之后,我可以git add,,就像它应该的那样。git commitgit push

但是,我想通过保存绕道并从本地用户gitssh克隆 repo 。project1.git

作为's 目录中的user1/pathToUser1Directory/以下内容也可以正常工作:

user1@hostname:~git clone /pathToGituserDirectory/project1.git. /pathToUser1Directory/project1-clone
Cloning into './project1-clone'...
done.

有问题的是使用git push来自user1的新克隆project1-clone

user1@hostname:~/project1-clone$ git push origin master
Counting objects: 3, done.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (3/3), 255 bytes | 0 bytes/s, done.
Total 3 (delta 1), reused 0 (delta 0)
^C
user1@hostname:~/project1-clone$

如您所见,推送添加和提交的文件效果不佳,因为 git 被困在路上的某个地方,我必须进行干预。添加和提交的文件不会显示在访问此存储库的其他(远程)成员上。

由于我(还)对 git 的理解有限和经验不足,我的问题是:

  1. 从用户git本地克隆的最佳方法是什么(ssh无需猜测)
  2. 我哪里出错了/如何从本地克隆的目录中推送文件。

希望有人可以跟踪我的解释并有一些想法。提前致谢。

PS:我可以将用户user1添加到同一组用户git,但与我描述的没有区别

PPS:用户git仅限于git-shell,但这可能不是问题

标签: gitgit-pushgit-clonegit-remote

解决方案


推荐阅读