Git clone through a reverse tunnel

后端 未结 5 1427
余生分开走
余生分开走 2021-02-04 03:24

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 pu

5条回答
  •  余生分开走
    2021-02-04 04:18

    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
    

提交回复
热议问题