需要在仅通过ssh访问的远程服务器上进行git安装 [英] git installation needed on remote server which is access via ssh only

查看:77
本文介绍了需要在仅通过ssh访问的远程服务器上进行git安装的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试从远程计算机到当前不包含任何git安装的服务器计算机进行访问.问题是:服务器计算机是否需要任何形式的git安装(我认为是必需的)才能通过ssh和git从客户端工作?

I'm trying to do an access from a remote machine to a server machine which currently does not contain any git installation. 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

在服务器上没有git的情况下,您将不能推/拉到遥控器.您用于对git repo进行远程操作的协议不会对此进行更改.

Yes you need git on the server

Without git on the server, you can't push/pull to the remote. The protocol you use to act remotely on your git repo, doesn't change this.

如果确实需要/想要将.git目录重新同步到远程服务器,则可以.由于.git/objects目录中的所有文件都基于哈希,因此不会发生任何冲突.

You can if you really need/want to just rsync your .git directory to a remote server. Because all files in the .git/objects directory are based on a hash, you won't get any collisions.

这原则上意味着:

# 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.

这篇关于需要在仅通过ssh访问的远程服务器上进行git安装的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆