user1146223
user1146223

Reputation: 209

Uploading to FTP and GIT at the same time?

So, I'm using a version control system for the first time on a personal project. In the past it's all been set up and fairly simple for me, but I'm setting things up myself this time around.

Since this is a web application I'm working with I'd like to be able to upload my files to the server automatically when I commit them.

Not sure if this is even possible, but I'm hoping it is. Seems like a pain to commit AND upload things manually.

Anyway, if it helps I'm using SourceTree and BitBucket using git.

Thanks in advance for the help!

Upvotes: 1

Views: 2271

Answers (2)

poke
poke

Reputation: 388173

There are a few utilities that help deploying things via FTP from inside a Git repository, for example git-ftp.

That way, you can work the way you want with your Git repository, and just execute the git-ftp script whenever you want to deploy it to your server, and it will automatically transfer the things via FTP.

I’d recommend not auto-deploying everything whenever you commit btw. as you should actually make sure that what you just committed is perfectly working. Separating it is a good idea, especially when you can deploy using just a single command.

Upvotes: 1

eskatos
eskatos

Reputation: 4464

I assume here that you ask about GIT, not SVN. Bitbucket do not support SVN repositories anymore.

You can automate FTP deployment using GIT hooks. Meaning that you can hook scripts in GIT events like when a new commit lands on the repository you can execute custom commands.

Here is a blog post that explain how to set things up so that you have live deployment using git hooks: http://joemaller.com/990/a-web-focused-git-workflow/

I use this myself for several sites and I'm happy with it.

Hope this helps.

/Paul

Upvotes: 0

Related Questions