Git FTP Push FTW!

Git is a wonderful tool that makes possible having your local repo and your GitHub repo always perfectly synchronized. This is cool and all, but — what about the production server?

If you are in a shared hosting that doesn’t have git or SSH support, you’ll probably find stressful to manually update your application via FTP each time, even for the tiniest of the edits.

Well, if that’s your case you really should check out git-ftp by René Moser.

Git-ftp is a straightforward way to connect to your FTP and automagically transfer only the files that changed since the last commit.

The usage is fairly simple:

1
$ git ftp push --user <user> --passwd <password> ftp://example.com/public

And you can make it even simpler by just setting defaults in your project’s .git/config file:

1
2
3
$ git config git-ftp.user john
$ git config git-ftp.url ftp.example.com
$ git config git-ftp.password secr3t

Now you can just do:

1
$ git ftp push

Et voilà! Your production server is up-to-date.

Comments