1

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!

nwellnhof
  • 28,336
  • 5
  • 76
  • 103
user1146223
  • 219
  • 3
  • 14

2 Answers2

1

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.

poke
  • 307,619
  • 61
  • 472
  • 533
0

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

eskatos
  • 3,495
  • 2
  • 33
  • 37