Cannot git clone a folder on a server and then edit and git push?

后端 未结 5 795
温柔的废话
温柔的废话 2021-01-14 23:41

I used Mercurial (Hg) before, and it was ok to do something like at the local PC:

hg clone ssh://peter@hostingcompany.com/~/mysite.com

and

5条回答
  •  鱼传尺愫
    2021-01-15 00:02

    In Git, you are only supposed to push to a bare repository. The best solution is to create a bare repository on the server that you push to, and then a non-bare clone of it which contains the checkout, so after you push to the bare repo, you SSH to the server and do git pull from the non-bare repo (or set up a hook to do so automatically after the bare repo receives the new version).

提交回复
热议问题