#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2009
    Posts
    95
    Rep Power
    30

    Version Control (Git) For Web Projects


    I'd like to use some version control with my web projects, but I don't want it to get in my way. Right now if I make a change to my project I have to commit it before I can view those changes live on the development server. I'd like to simply be able to save a file, which then pushes it out onto the server. Then, at my choosing, I can commit my project to the repository. Any suggestions?

    I'm using:

    Ubuntu 10.10
    SSH (Public key)
    GIT
    Apache/PHP/MySQL
  2. #2
  3. Wiser? Not exactly.
    Devshed God 1st Plane (5500 - 5999 posts)

    Join Date
    May 2001
    Location
    Bonita Springs, FL
    Posts
    5,959
    Rep Power
    4035
    Either do your changes on the development server, or setup your own local server on your PC to do your dev work. Once your happy with the changes, commit them.
    Recycle your old CD's, don't just trash them



    If I helped you out, show some love with some reputation, or tip with Bitcoins to 1N645HfYf63UbcvxajLKiSKpYHAq2Zxud
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2009
    Posts
    95
    Rep Power
    30
    Working on my development server won't work - it's just a console-only VM.

    Working on my PC won't work - It's a windows environment and doesn't have all the necessary software (PHP has various EXEC calls to programs installed on the server)

    However, I have thought about it a little and understand what you're trying to say. There are trade-offs to consider, but this might work:

    1. Install samba on server
    2. Install git on all client workstations (single developer, multiple workstations)
    3. Set up a git repository in /var/www/project
    4. Directly edit files in /var/www/project vis Samba when developing. This makes the changes testable on the development server.
    5. When I'm happy with the changes I've made, use git to commit.

    Now I can edit directly on the server AND I get the benefits of versioning, branches, etc...right? I realize this is not a solution in a multi-developer environment, but I believe it would work for just me.
  6. #4
  7. Code Monkey V. 0.9
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Mar 2005
    Location
    A Land Down Under
    Posts
    2,136
    Rep Power
    1990
    If you are doing the work on the live server the best option that you can have is to use whatever text editor program is on that server to edit the files. You can do this through SSH or remote session or any one of a fair few other options.

    Personally, I'd look at setting up and using a REAL dev server for this. That way you can set it up just like your production server, do the changes on there and when they are stable, push them live. This will save you a lot of grief when you do get something wrong that updates/deletes live data (or whatever else). I've done that myself, so I know just how easy it is to destroy things that you didn't want to when you do it like that.

IMN logo majestic logo threadwatch logo seochat tools logo