使用 git 在没有 SSH 访问权限的情况下部署我的网站
Using git to deploy my website without SSH access
我使用 git 跟踪我网站的更改。目录结构为:
$ ls my-page
Gruntfile.js node_modules webpage package.json
当然,我只想将 webpage
子目录的内容推送到服务器。此外,我想忽略 webpage/assets/sass
子目录。我的 Internet 连接速度相当慢,所以我希望上传是增量的,或者至少只上传自上次提交以来更改的文件。我不想上传未提交的更改。
我知道 git-ftp
但据我从文档中看到的,我只能上传整棵树。
是否可以达到我想要的效果?
不是这样因为 git doesn't store the deltas (changed files) and each commit contains every file in the repository at that snapshot in time.
但是,您可以 create a shallow clone with just your tip commit and force push that to the remote。然后,这将通过 git.
将最少量的数据推送到网络上
或者,既然是生产环境,那么维护版本控制系统只有在紧急回滚时才有用。那么为什么不简单地编写一个发布包呢?使用类似 rsync 的东西,它只会传输修改后的文件,而不是整个存储库。
我使用 git 跟踪我网站的更改。目录结构为:
$ ls my-page
Gruntfile.js node_modules webpage package.json
当然,我只想将 webpage
子目录的内容推送到服务器。此外,我想忽略 webpage/assets/sass
子目录。我的 Internet 连接速度相当慢,所以我希望上传是增量的,或者至少只上传自上次提交以来更改的文件。我不想上传未提交的更改。
我知道 git-ftp
但据我从文档中看到的,我只能上传整棵树。
是否可以达到我想要的效果?
不是这样因为 git doesn't store the deltas (changed files) and each commit contains every file in the repository at that snapshot in time.
但是,您可以 create a shallow clone with just your tip commit and force push that to the remote。然后,这将通过 git.
将最少量的数据推送到网络上或者,既然是生产环境,那么维护版本控制系统只有在紧急回滚时才有用。那么为什么不简单地编写一个发布包呢?使用类似 rsync 的东西,它只会传输修改后的文件,而不是整个存储库。