使用Git共享托管计划 [英] Using Git with shared hosting plan

查看:119
本文介绍了使用Git共享托管计划的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因此,我开始将Git与此工作流程一起使用建立一个个人网站(主要用于测试和学习Git),我正在使用Xamppp在我的笔记本电脑上本地开发它。



但是现在我想让这个网站公开并将其上传到我的网络服务器。问题是,我使用共享主机方案,这意味着我只能通过FTP访问我的网站目录。无法使用SSH或安装Git或任何东西..



我想部署网站和任何更新到该网络服务器,但我想知道,如果这是可能的Git只有FTP访问?如果不是,更新我的网站会是一个明智的方法吗?通过Filezilla手动拖放文件可能会有点繁琐。

解决方案

如果您没有对远程服务器的SSH访问权限,托管服务提供商不提供git部署功能,您将无法直接使用git进行部署。



然而,跟踪您的源代码总是一个好主意无论远程选项如何。



在您的情况下,自动执行发布过程的一个很好的选择是使用您最喜欢的编程语言(Ruby,Python, Bash ...),它从你的git版本库加载已更改文件的列表,并通过FTP上传这些文件。



简单搜索 git-ftp 显示已有两个项目似乎按照我的建议进行:


So I started using Git together with this workflow to make a personal website (mostly for testing and to learn Git) and I am developing it locally on my laptop using Xampp.

But now I would like to make this website public and upload it to my webserver. Problem is, I use a shared hosting plan which means I only have FTP access to my website directory. Can't use SSH or install Git or anything..

I would like to deploy the website and any updates to that webserver, but I was wondering if that was possible with Git with only FTP access? And if not, what would be an advisable way to update my website? Manually drag an dropping files through Filezilla can get a bit tedious.

解决方案

If you have no SSH access to the remote server and the hosting provider doesn't offer a git deploy feature, you won't be able to deploy directly using git.

However, it's always a good idea to track your source code regardless the remote options.

In your case, a good alternative to automate the release process would be to create a simple deploy script in your favorite programming language (Ruby, Python, Bash...) that loads the list of changed files from your git repository and performs an upload via FTP of these files.

A simple search for git-ftp reveals that there are already two projects that seems to do what I suggested:

这篇关于使用Git共享托管计划的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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