如何在我的共享hostgator上创建一个git仓库? [英] How do I create a git repo on my shared hostgator?

查看:171
本文介绍了如何在我的共享hostgator上创建一个git仓库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在我的共享hostgator上创建一个git repo?
获得SSH访问的方式。

  git init --bare / path / to / repo 

如果未安装Git,您将无法直接推送到托管存储库,但可以通过执行以下操作(从这里):

首先,在您的本地机器上运行这些命令(假设您的仓库本地位于〜/ foo ):

  git clone --bare〜/ foo〜/ foo.git 
cd〜/ foo.git
git --bare update-server-info
code>

然后,将生成的 foo.git 目录复制到您的网络服务器的 public_html 目录。这样做后,您应该能够从 http://yourserver.com/you/foo.git 或诸如此类。任何时候你想更新快照,你都需要重复上述步骤。


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

解决方案

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.

这篇关于如何在我的共享hostgator上创建一个git仓库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆