How do I create a git repo on my shared hostgator?

☆樱花仙子☆ 提交于 2019-12-05 00:29:02

问题


How do I create a git repo on my shared hostgator? Got SSH access by the way.


回答1:


Assuming Git is installed...

git init --bare /path/to/repo

If Git isn't installed, you won't be able to push directly to the hosted repository, but you can make a snapshot available by doing the following (from here):

First, on your local machine, run these commands (this assumes your repo is at ~/foo locally):

git clone --bare ~/foo ~/foo.git
cd ~/foo.git
git --bare update-server-info

Then, copy the resulting foo.git directory into your webserver's public_html directory. After doing so, you should be able to pull from the http://yourserver.com/you/foo.git or the like. Any time you want to update the snapshot, you'd need to repeat the above steps.



来源:https://stackoverflow.com/questions/9593183/how-do-i-create-a-git-repo-on-my-shared-hostgator

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!