Alex Rivera | Logout

Git clone through a reverse tunnel

Asked 2011-06-08T19:15:52.010
22

I have my Git repo on my machine, which has no public IP of its own, at home; I want to clone this repo at my web server. Is it correct that a reverse tunnel will allow me to pull from my machine to the server? What command(s) do I issue to perform the clone? My local machine runs Windows; the server runs Ubuntu.

Edit
Report

1 Answer

11

You could push the changes to the web server, instead of trying to pull them:

Set up a repos on the web server:

cd /somedir
git init --bare

Push to that repos from your dev machine:

git remote add web user@web:/somedir
git push web master 

If you want to push to a non-bare repos (e.g. if your web app runs in a checkout), then you will need to push to a branch which is not currently checked out and then merge in.

i.e. on your dev machine:

git push web master:master-from-dev

then log into the web machine and do:

git merge master-from-dev
answered 2013-05-11T11:51:36.340

Your Answer