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

Version Control?

  • So I've attempted to understand Git, had a look at subversion etc but I'm still stumped on how to really get started for version control and how it all works.

    My customers sites aren't massive, but I do have a large one coming up and I will be working closely with another coder.

    Does anyone have any articles or tips, 101 basics style for getting into version control and sharing?
  • http://css-tricks.com/video-screencasts/101-lets-suck-at-github-together/

    We use Github at the office, it's pretty handy.

    If you're on a Mac, there's an Github for Mac app which allows you to stay out of Terminal.
  • Thanks guys - I've followed the videos and thanks to @chriscoyier ended up buying Tower, getting an account on Beanstalk and finally upgraded to MAMP Pro (though luckily MySQL hasn't given me any issues yet, Chris!).

    Can safely say that they have revolutionised my development in just a few days of using them. Once again CSS-Tricks knocks it out of the park for a homerun :D
  • Just curious... I'm going through these videos because I'm curious about without quite taking the plunge, but how does this work if you have 3 different computers you might work from? I have my home office, my laptop and my work office I work out of at an almost equal split.

    Is it feasible to have local deployment identical on all 3 platforms that update with whatever projects I'm working on any time they are online?

    The only huge wrench I see is that my work office sports a windows box and the rest of my life is mac. Just waiting on that Mac Mini refresh :)
  • I sort of double up and have it both in Dropbox and a commit history on Github.

    I have it in Dropbox so that I can work on the project from any one of my machines. Then I commit major changes / revisions with Git.
  • Ahh ok - so you setup all of your local sites that you are committing right in the dropbox folder and work from there. Very cool I'll have to jump in soon here :)

    I might try and set it up on Google Drive. I finally switched all my email over to Google apps after tearing my hair out trying to get an Exchange service to work correctly and with that came the space. Maybe it could be a trial run!
  • Isn't Git the solution to this? Aside from the DB which would be a semi manual. Unless I'm wrong you could simply pull down changes to the other devices and you would have the most recent commit.
  • The only problem with that is if you forget to commit something. That's why I like to keep everything in Dropbox.
  • Hmm I see your point - think I'll start doing the same when I get my MacBook Air (which will be for couch coding).

    I do wish there was a straightforward way of MySQL management though - as while my above solution works I would prefer it to just be automatic if possible.

  • Hey all - so I'm deciding to start going this route. I really need to get into the habit of version control.

    I've got 2 questions here if someone can enlighten me whose pushed through it :)

    1) When I'm looking at Git plans - do I need to worry about public versus private repositories? and what constitutes a repository? Would one load like like 50 client sites into one repository or is it more of a 1:1 ratio?

    2) @andy_unleash - that's one thing I'm really wondering about on the mySQL management. It sounds like in Chris' video that you just kind of get into the habit of excluding anything that references the database. Is there any way to set that globally? I can see that being a really crappy hiccup :P
  • At the office we go with 1 repo per project, but I'm sure people are fine doing it other ways.

    A public repo means anyone can go to it and download the files.
  • Hmm that kind of worries me. @TheDoc - how do you guys manage 1 time log ins? I'm assuming based on what you are saying is that you work on your active projects on Git, then dump them? Maybe beanstalk might be used to manage multiple connections?

    I'm just wondering how the workflow functions when you are working on a lot of projects plus you have to make small changes on a couple projects that have been finished for a month or two. Not sure I want to go with the silver plan for $50/mo just to manage my active projects.
  • Well, we have a larger team. I think we're on Gold. We have one repo that consists of 'old projects'. These are things that we don't expect to change at all (or at the very most 1-2 changes per year).

    If you don't have too many active projects at once, you might be good with going with 'micro' and then put older projects into a separate repo.