gpt4 book ai didi

windows - Git 推送到 LAN repo 停顿或停止而没有错误

转载 作者:可可西里 更新时间:2023-11-01 11:18:10 27 4
gpt4 key购买 nike

意图

我打算在 windows 本地网络中建立一个版本控制服务。

测试环境

我有一个 /root 文件夹,其中有 2 个 repos /foo/bar

尝试

有人建议我使用 git-daemon 服务 ( http://git-scm.com/docs/git-daemon ),但它比宣传的更复杂(并且工作方式不同)。

我找到的第一个指南是 http://railsware.com/blog/2013/09/19/taming-the-git-daemon-to-quickly-share-git-repository/ .我在“/root”文件夹中使用了他们的 git 守护程序选项,该文件夹将为其中包含的所有存储库提供服务:

$ git daemon --base-path=. --export-all --reuseaddr --informative-errors --verbose

我成功地克隆了一个空的 repo,但是当我添加一些内容时,我收到了消息:

$ git clone git://root-ip-addr/bar

Cloning into 'bar'...

remote: Counting objects: 3, done.

remote: Total 3 (delta 0), reused 0 (delta 0)

fatal: read error: Invalid argument

Receiving objects: 100% (3/3), done.

fatal: error in sideband demultiplexer

接下来我找到了http://www.gitguys.com/topics/creating-a-shared-repository-users-sharing-the-repository/他们甚至没有提到守护进程,而是选择了本地文件夹作为远程方法。我仍然认为我需要一个守护进程,所以我尝试在守护进程上添加 -enable:receive-pack 选项时让我的 repos 裸露。

他们建议在客户端机器上使用分支来提交,所以我做到了。我还致力于 master 分支看看会发生什么。在这两种情况下,GIT 似乎都停止了。

这是客户端计算机尝试推送到中央集线器的屏幕截图。你可以看到它在那个时候停止了。

when attempting to push from a client

这是运行守护程序的中央集线器的屏幕截图。

daemon response

在那之后我只能输入 ctrl+c 来完全停止 git 守护进程。

我真正让它工作的唯一方法是从存储库内部调用守护进程,但这将需要为每个存储库都这样做(我打算为数百个存储库建立它)

我知道我应该花几周的时间来彻底理解 Git,这是我在过去 6 个月里推迟的事情,因为我已经能够完成基本的克隆、添加和提交。

话虽如此,我认为在尝试解释 git 工作流比喻时,应该有更具视觉建设性的指南。

感谢您的宝贵时间。

最佳答案

好像跟bug #101有关(谷歌代码问题 457)在 msysgit 中引入了修复 Git-1.9.4-preview20140611 .

设置 sendpack.sideband 配置选项,然后再次推送即可。

git config --global sendpack.sideband false
git push origin ...

我用这个 git 守护进程命令试过了

git daemon --base-path=. --export-all --reuseaddr --informative-errors \
--verbose --enable=receive-pack

关于windows - Git 推送到 LAN repo 停顿或停止而没有错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28098341/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com