Git 通过有限的 ssh 推送到实时服务器

发布于 2024-10-11 21:30:31 字数 584 浏览 5 评论 0原文

我使用 GitHub 来跟踪我的源代码。虽然我独自工作,但测试新功能并在不起作用时回滚确实很方便。所以,我在我的 Windows 机器上安装了 Git Bash,然后提交并提交。代码准备好后推送到github。

现在,我想更进一步并从同一终端进行部署。我的共享主机具有 SSH 访问权限,但有点有限。他们告诉我他们有 Git,但只能作为客户端来阅读存储库。我不知道这意味着什么。

我试图在实时服务器上创建一个存储库,将其添加为我的计算机上的远程版本,然后只需“git Push Remote Live”,但这不起作用。

每当我在实时服务器上输入“git init”时,它都会返回:

warning: templates not found /usr/share//git-core/templates/

Initialized empty Git repository in /www/example.com.ar/htdocs/example.com.ar/.git/

而且我无法“git clone”或“git pull”或任何东西!

你有什么建议可以给我吗?我只是厌倦了通过 FTP 拖放文件夹,感觉太不对劲了!

提前致谢

I'm using GitHub to keep track of my source code. Although I work alone, it comes really handy to test new features and rollback if it doesn't work. So, I installed in Git Bash in my windows machine, and commit & push to github when the code is ready.

Now, I want to take this further and deploy from the same terminal. My shared-hosting has SSH access but is kinda limited. They told me they had Git, but only as a client, to read repos. I don't know what that means.

I was trying to make a repo on the live server, add it as remote on my machine and then just 'git push remote live' but that didn't work.

Whenever I type 'git init' on the live server it returns:

warning: templates not found /usr/share//git-core/templates/

Initialized empty Git repository in /www/example.com.ar/htdocs/example.com.ar/.git/

And I can't 'git clone' or 'git pull' or anything!

Is there any tips you can give me? I'm just tired of drag&dropping my folder via FTP, it just feels so wrong!

Thanks in advance

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

谜兔 2024-10-18 21:30:31

GitHub 是 git 服务器,

您和您的主机都只是充当客户端。

您需要做的就是(如果 git 安装正确)登录您的 ssh 会话。

在终端中输入以下内容

git clone git://github.com/<username>/<name of repo>.git folder_name

,将该 git 存储库克隆到 folder_name 中,

以获取已推送到实时服务器的更新,您需要再次登录 ssh 和 git pull

GitHub is the git server

Both you and your hosting will simply act as clients.

all you need to do (if git is properly installed) log into your ssh session.

type the following into the terminal

git clone git://github.com/<username>/<name of repo>.git folder_name

to clone that git repo into folder_name

to get updates you have pushed to the live server, you need to again, log into ssh and git pull

梦途 2024-10-18 21:30:31

有一个 git 服务器可以处理传入的 git 请求,因此您无需通过 SSH 访问它。它不是很受欢迎(仅相对于客户端)并且您不需要它。 git 客户端应该就是您所需要的。听起来他们的安装还有其他问题。

也许其他人可以在这里插话并让 git 在这个有限的环境中为你工作,但是当有这么多非常便宜且非常灵活的主机时,切换到其中一个并解决所有问题可能会更容易合二为一。

Dreamhost、MediaTemple、RackspaceCloud、Slicehost 和(当然)Amazon EC2 只是一些值得一试的可靠托管服务。

There is a git server that'll handle incoming git requests so you don't need to access it via SSH. It's not very popular (relative to just the client) and you don't need it. The git client should be all you need. It sounds like there is something else wrong with their install.

Perhaps someone else can chime in here and get git working in this limited environment for you, but when there are so many dirt cheap and really flexible hosts out there it's probably much easier to switch to one of them and solve a whole gamut of problems all in one.

Dreamhost, MediaTemple, RackspaceCloud, Slicehost, and (of course) Amazon EC2 are just a few of solid hosting services worth checking out.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文