简体   繁体   English

需要在仅通过ssh访问的远程服务器上进行git安装

[英]git installation needed on remote server which is access via ssh only

I'm trying to do an access from a remote machine to a server machine which currently does not contain any git installation. 我正在尝试从远程计算机到当前不包含任何git安装的服务器计算机进行访问。 The question is: Does the server machine need a git installation in any kind (i assume it needs) to work from the client only via ssh with git? 问题是:服务器计算机是否需要任何形式的git安装(我认为是必需的)才能通过ssh和git从客户端工作?

Yes you need git on the server 是的,您需要在服务器上使用git

Without git on the server, you can't push/pull to the remote. 在服务器上没有git的情况下,您将无法推/拉到遥控器。 The protocol you use to act remotely on your git repo, doesn't change this. 您用于对git repo进行远程操作的协议不会对此进行更改。

Poor mans git 可怜的人吉特

You can if you really need/want to just rsync your .git directory to a remote server. 如果确实需要/想要将.git目录重新同步到远程服务器,则可以。 Because all files in the .git/objects directory are based on a hash, you won't get any collisions. 由于.git / objects目录中的所有文件都基于哈希,因此不会发生任何冲突。

That would mean in principle: 这原则上意味着:

# git push
rsync -rv .git server:repo.git

# git pull
rsync -rv server:repo.git .git
git reset HEAD --hard # Here lies the problem with this technique.

您需要在服务器上进行Git安装,才能在服务器上设置真正的远程存储库,我可以建议您使用Gitolite ,它可以正常工作...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM