ftp 服务器上的 Git 存储库 [英] Git repository on ftp server
问题描述
我有 ftp 服务器,但无法在其上安装其他软件.是否可以在其上创建 git 存储库并克隆到本地 PC?我尝试创建本地存储库并将其复制到 ftp.它会起作用吗?如何从 ftp 服务器克隆?
I have ftp server and I cannot install additional software on it. Is it possible to create on it git repository and clone to local pc? I tried to create local repository and copied it to ftp. Will it work? How can I clone from ftp server?
推荐答案
StackOverflow 上还有很多其他问题讨论这个主题,例如:
There are various other questions on StackOverflow that discuss this subject, e.g.:
...可能有适合您的情况的解决方案.
... which might have a solution that's suitable for your case.
您没有说明您使用的是什么操作系统,但如果它是基于 Linux 的,我会尝试将 FTP 服务器作为本地文件系统的一部分安装在 FUSE + fuseftp.如果您使用的是 Mac OS,同样可以尝试 MacFuse.(注:我自己从未尝试过 fuseftp,所以我无法推荐或不推荐它.)毫无疑问,Windows 也有类似的.
You don't say what operating system you're using, but if it's Linux-based what I would try is to mount the FTP server as part of your local filesystem with FUSE + fuseftp. If you're using Mac OS, you could similarly try MacFuse. (n.b. I've never tried fuseftp, myself, so I'm not in a position to recommend or disrecommend it.) No doubt there are equivalents for Windows as well.
那么您应该只能够在挂载的目录中运行 git init --bare
并从中推送和拉取,因为它是本地存储库.您还应该启用示例 post-update
挂钩,以便在每次推送后运行 git update-server-info
- 否则人们在与服务器交互时会遇到问题ftp://
存储库 URL.
Then you should just be able to run git init --bare
in the mounted directory and push and pull from it as it it were a local repository. You should also enable the example post-update
hook so that git update-server-info
is run after each push - otherwise people will have problems when interacting with the server with an ftp://
repository URL.
这篇关于ftp 服务器上的 Git 存储库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!