sync two computers going through a bridge with rsync
You could use the ProxyCommand option to ssh to forward the traffic through B. Doing this means that the files don't ever have to live on machine B at all. For example (going from machine A to C):
rsync -av -e 'ssh -o "ProxyCommand ssh -W %h:%p username1@B"' ~/BACK_UP/ username2@C:/home/BACK_UP/
Or you can put the ProxyCommand in your ~/.ssh/config file. Something like:
Host C
Hostname C
User username2
ProxyCommand ssh -W %h:%p username1@B
With this you should be able to do ssh transparently from A to C
git repository sync between computers, when moving around?
I think, there are multiple approaches. I will just describe, how I handle this
I have one netbook as a 24/7 server, that holds multiple git-repositories. From/To there I push and pull changes via SSH. For access from outside I use dyndns.org. It works fine, especially because I have more than two systems, that needs access to some of the repositories.
Update: A little example.
Lets say my netbook is called "netbook". I create a repository there
$ ssh username@netbook.local
$ cd ~/git
$ mkdir newThing
$ cd newThing
$ git init --bare
On my desktop I will than create a clone of it. Maybe I will add some files also
$ git clone username@netbook.local:/home/username/git/newThing
$ git add .
$ git commit -m "Initial"
$ git push origin master
On my portables I will (first) do the same, but for remote access (from outside my LAN), I will also add the external address.
$ git clone username@netbook.local:/home/username/git/newThing
$ git remote add externalName username@mydyndns.home-ip.org:/home/username/git/newThing
$ git pull externalName master
Its just the way git (/git workflows) works. You can add as many remote repositories as you like. It doesnt matters, if two or more refers to the same "physical" repositories. You dont need an own local "server", you can use any public server, to which you have ssh access. And of course you dont need a public server at all, if you dont need access from outside. The bare repository can also be on the desktop system and you can then create a working-copy-repository within the local filesystem.
$ mkdir myRepo; cd myRepo
$ git init --bare
$ cd /path/to/myProject
$ git remote add origin /path/to/myRepo
$ git add .; git commit -m "Initial"; git push origin master
This is the way, how I handle this, and I for me it works quite fine (if not perfect ;))
Something to read: http://progit.org/
Really good book.-
Related Topics
Shell Command to Update Pom File from a Variable
What Does Version Info in Ldd -V Mean
.Zshrc Config File Syntax Error
How to Grep While Avoiding 'Too Many Arguments'
How to Print a Number in Arm Assembly
Does 'Dash' Support 'Bash' Style Arrays
Linux Get Process Name from Pid Within Kernel
Getmodulehandle(Null) on Linux
Xargs Sh -C Skipping the First Argument
Setting the Thread /Proc/Pid/Cmdline
How to Store Linux Command Output into a Variable in Puppet
Remove All Text from Last Dot in Bash
Difference Between Linux Kernel and Unix Kernel(Such as Freebsd) from Programmer's Point of View
Getting Meteor 0.9.2 Build to Work Osx -> Linux
Server Composer Install --No-Dev Killed
Bash Script Variable Scope Issue
How to Wait for a Keystroke Interrupt with a Syscall on Linux