git update/patch on remote host without internet

情到浓时终转凉″ 提交于 2019-12-10 10:05:09

问题


I have a host with access threw vpn for example: 10.0.0.2 That host has no access to my git repository, and to the internet at all.

i do not want to copy all the time zip archive with full project and unzip it on 10.0.0.2.

git format-patch mybranch --root --stdout > ~/Downloads/mypatch.patch creates me 1gb patch, and i cant apply it. git format-patch -1 HEAD here i can't understand how many commits i need, and how to apply them.

So the question is: how can i update my project on that host?

EDITED:

thanks for advice with rsync, i wrote a little expect script:

#!/usr/bin/expect -f
set timeout 2
set USER "REMOTE_HOST_USER"
set PASS "REMOTE_HOST_PASSWORD"
set HOST "REMOTE_HOST" # in my case 10.0.0.2

spawn rsync -a --stats . $USER@$HOST:/path/to/project/on/remote/host/;
expect {
    "(yes/no)?*" {
    send "yes\r"
    }
}
expect "word:"
send "$PASS\r"
interact

This script syncing my current folder and folder on remote host.


回答1:


You can use git bundle for that, generating one file, a bit like an archive except it is a git repo from which you can pull.

And you even can generate an incremental bundle, in order to copy only the last few commits over (still as one file), and pull form that incremental bundle.



来源:https://stackoverflow.com/questions/24075488/git-update-patch-on-remote-host-without-internet

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!