3

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.

Tapo4ek
  • 313
  • 2
  • 7

1 Answers1

2

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.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250