treehouse : what would you like to learn today?
Web Design Web Development iOS Development

Get into version control

  • Hey guys,

    For a long time I had the habit to make all the changes on my website through FTP. So I was working on the live site. But now I decided to move on to git for version control, but I still want to develop right on a server for PHP stuff and to have simple access to the new code if someone else has made a change

    The workflow should be the following: 1. I make a change on the dev server 2.The changes should be automatically committed to my Bitbucket repo 3. When the entire work is done, I want to push it to the live server

    What could be the simplest solution for this purpose?

    Thanks in advance for your answers.

    Edit: I forgot to mention that I'm using Mac OS X and that my server is running Apache

  • Hmm I noticed that there is a git integration in Coda 2, but I don't understand yet how that's working :(

  • For something like this, you'll need Git installed on both development and production servers. Here's a link that might be helpful in getting you started: https://gist.github.com/oodavid/1809044

    Coda 2 has a nice Git integration, if rather simplified -- once you open a Git repository from within Coda, you'll see branch information in your sidebar, and edited files will have icons beside them indicating if lines have been added or removed, etc. You can also commit from Coda.

    Personally, I prefer combining Sublime Text 2 (with the Git plugin) and SourceTree's GUI to work with git, and I'm trying to get better with the command line, thanks to zsh, oh-my-zsh and the agnoster theme. ^__^

  • Thanks for your answer so far :)