git - git-clone local 从 git-only 用户到普通用户(debian) - git-push 需要很长时间/没有完成
问题描述
最近我启动了自己的 git 服务器,现在基本上可以正常工作。
情况:在我的服务器上有像git和user1这样的用户。前者应该管理/存储我的 git 项目并让它们在本地和远程访问。后者只是我用来运行电报机器人或其他东西的普通用户。通常我为用户git创建一个裸 git 存储库,project1.git
并且在用户user1的目录中已经有子目录project1
,我通过git init
.
按照ProGit 之类的说明,我从's 目录链接project1
到project1.git
这样的user1 :project1
git remote add origin ssh://git@hostname:1234/pathToGituserDirectory/project1.git
在此之后,我可以git add
,,就像它应该的那样。git commit
git 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 的理解有限和经验不足,我的问题是:
- 从用户git本地克隆的最佳方法是什么(
ssh
无需猜测) - 我哪里出错了/如何从本地克隆的目录中推送文件。
希望有人可以跟踪我的解释并有一些想法。提前致谢。
PS:我可以将用户user1添加到同一组用户git,但与我描述的没有区别
PPS:用户git仅限于git-shell
,但这可能不是问题
解决方案
推荐阅读
- javascript - 如何创建一个从 API 获取图像并使用 ReactJs 下载到本地的按钮
- windows - 我应该从哪个存储库下载 Redis(Windows 版本)?
- sql - 如何将日期时间列拆分为日期列和连接时间,对于同一日期,SQL Server 2012 中的列
- charts - 更改 x 值标签以跟上日期的图表?
- python - 安装 python eth-wallet 时需要 Visual C++ 错误
- java - 如何使用 Kotlin 在 android 中更改 TextClock 的格式
- web-scraping - scrapy:使用“显示更多”按钮从网站上抓取数据
- c - C如何大写字母?
- linux-device-driver - .ndo_start_xmit 需要哪些步骤才能工作?
- google-tag-manager - 为什么 GTM 限制标签部署不起作用