git+ftp: Publish Git repository over FTP

by Adrian Mejia in November 10, 2011

I have been working with websites for a while and also with different web hosts. The default way to upload content is through FTP but it takes a lot of time because upload the entire site each time. Some web hosts  have ssh and git, which is great for deployement because you can keep track of the versions and also upload only the files that changes.

In order to use git for local development and ftp (for hosting that doesn't support git/ssh) there are some options: - Git powered FTP client written as shell script. - A quick and efficient way of pushing changed files to a website via FTP using python.
I have use ezyang/git-ftp to deploy my drupal websites with good results.
1. Install 'git-python' first from -or- using `easy_install gitpython`
2. git clone
3. You can create an alias for easy access in `~/.bash_profile` such as `alias git-ftp="python ~/git-ftp/ "`
4. Just run the command `python ~/git-ftp/ ` where is your git repository that you want to upload. I will prompt all the ftp details and also will create the config file for you.
You might want to setup files to ignore. If you are using drupal you should create a .gitignore file with a content similar to this:

# Ignore configuration files that may contain sensitive information.


# Ignore paths that contain user-generated content.



Tags: drupal, git, web development, ftp, gitignore

Add a new comment