简体   繁体   中英

Using git to deploy my website without SSH access

I track my website's changes using git. The directory structure is :

$ ls my-page 
Gruntfile.js     node_modules     webpage      package.json

Of course, I'd like to push only the webpage subdirectory contents to the server. Besides, I'd like to ignore the webpage/assets/sass subdirectory. My Internet connection is fairly slow, so I'd like the upload to be incremental, or at least upload only the files changed since the last commit. I don't want to upload uncommitted changes.

I know about git-ftp but as far as I see from the docs, I can upload only the whole tree with it.

Is it possible to achieve what I want?

Not like this because git doesn't store the deltas (changed files) and each commit contains every file in the repository at that snapshot in time .

However, you could create a shallow clone with just your tip commit and force push that to the remote . This would then push the minimum amount of data over the wire through git.

Alternatively, since this is a production environment, then maintaining a version control system is only really useful for emergency rollbacks. So why not simply script a release package? Use something like rsync which would only transfer the modified files, and not the whole repository.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM