简体   繁体   中英

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

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.

Poor mans git

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.

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 ,它可以正常工作...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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