marmistrz
marmistrz

Reputation: 6392

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?

Upvotes: 0

Views: 545

Answers (1)

Jeff Puckett
Jeff Puckett

Reputation: 40861

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.

Upvotes: 1

Related Questions