News for hackers. Stuff that matters.

Ask HN: How do I get started with version control?

I do mostly wordpress dev and design. Most php, css, xhtml, jquery but I am looking to advance and work on some web apps in the near future.

I have grown to appreciate version control and I know most people here think very highly of Github. However, I have no idea how to even get started with taking advantage of github or any form of version control. I would appreciate your input. FYI: I do my work with Coda on a Mac.

( 31 comments | 25 points | on HN )
Re:Ask HN: How do I get started with version control? by gcv on Saturday May 22, 2010 @01:34PM (#1370693)
I myself prefer Git, but Joel Spolsky wrote a really slick tutorial for Mercurial: http://hginit.com/

Once you learn about how VCS works, and have used something for a while, you'll be able to make an educated decision about switching to something else.

Re:Ask HN: How do I get started with version control? by arien on Saturday May 22, 2010 @09:15PM (#1371471)
The Subversion re-education bit is great to understand the differences between Mercurial and SVN, thanks for the link :)
Re:Ask HN: How do I get started with version control? by chasingsparks on Saturday May 22, 2010 @11:58AM (#1370512)
Github has some good resources.

http://help.github.com/

If you want to understand how git works -- and therefore know what it can do -- see: http://ftp.newartisans.com/pub/git.from.bottom.up.pdf

Re:Ask HN: How do I get started with version control? by eswat on Saturday May 22, 2010 @02:52PM (#1370793)
If you go ahead with trying out git, then check out Pro Git: http://progit.org/book/

Read the first 2 chapters, sign up for an account on GitHub and mess around with a public repo for a bit. Once you become familiar with adding, staging, commiting, etc. then you can either try out another VCS like Mercurial or SVN, or move onto Chapter 3 and get comfortable with branching and merging in Git.

There's also a very nice GUI for Git on OSX called GitX. It won't let you do push/pull on remotes but it's great to understanding what's happening to your repos outside of a CLI: http://gitx.frim.nl/

Re:Ask HN: How do I get started with version control? by admp on Saturday May 22, 2010 @03:01PM (#1370815)
There's also an experimental fork of GitX that adds basic support for pulling/pushing, etc. See here: http://github.com/brotherbard/gitx
Re:Ask HN: How do I get started with version control? by weaksauce on Saturday May 22, 2010 @04:06PM (#1370951)
I know it's experimental but how stable is it in practice?
Re:Ask HN: How do I get started with version control? by admp on Sunday May 23, 2010 @05:50AM (#1372080)
Have been using it for over a month now, no problems yet.
Re:Ask HN: How do I get started with version control? by taphangum on Saturday May 22, 2010 @11:56AM (#1370506)
Re:Ask HN: How do I get started with version control? by bwh2 on Saturday May 22, 2010 @12:39PM (#1370589)
Subversion would also work just fine. Some hosts already have Subversion installed, so setting things up is quite easy. Here are some examples:

Dreamhost: http://wiki.dreamhost.com/Subversion

MediaTemple: http://kb.mediatemple.net/questions/143/Using+Subversion

I use Subversion for projects that I don't release open source. For me, that works better than paying github a monthly fee. Anyway, the point is that you shouldn't feel like git is the only option.

Re:Ask HN: How do I get started with version control? by prog on Saturday May 22, 2010 @03:27PM (#1370873)
I have been using bzr for quite some time. While my host didn't provide bzr (but did support Python), it was just a matter of untaring it and adding it to the path on the server. It worked out quite well as one fine day the server crashed and lost all the data. Luckily I had a bzr repo locally so it was just a matter of pushing it to the server.

For private hosting I basically use bzr+ssh smart server on my host and launchpad for my hobby projects.

Re:Ask HN: How do I get started with version control? by pingswept on Saturday May 22, 2010 @04:00PM (#1370938)
It seems you're getting a lot of advice to choose Git or Mercurial over Subversion. I haven't used Mercurial, but I have used Git and Subversion for years.

I think Git (or maybe Mercurial) is actually the answer to a different question: "What's the best version control system to use?" Starting with Git, particularly if you're not using OS X, which has better GUI tools for Git, seems to me to be a quick trip to insanity. To get started with version control, I think Subversion is substantially easier.

But it's not too hard to try both. Make an account on Github, create a repository, and try it out. If, by tomorrow night, you want to gouge your eyes out with a spoon, try Subversion.

(Subversion will definitely make you want to gouge your eyes out too, but not for a few months. Then you can switch to Git!)

Re:Ask HN: How do I get started with version control? by philwelch on Saturday May 22, 2010 @05:15PM (#1371069)
Git would actually be easier, I think, for most people to learn if they didn't already have Subversion experience and hence Subversion ways of doing things coloring their preconceptions. It's a beast of a system though--you have to actually learn how to use it, rather than depend on your intuition and hope that it's usable--but it's worth learning and probably easier than learning 1 or 2 other version control systems and having to unlearn them along the way.
Re:Ask HN: How do I get started with version control? by pingswept on Saturday May 29, 2010 @02:53PM (#1389102)
As someone who has been slowly unlearning SVN, I agree. Still, learning Subversion was trivial compared to Git, regardless of which I learned first.
Re:Ask HN: How do I get started with version control? by jonpaul on Saturday May 22, 2010 @02:58PM (#1370807)
My vote goes to Git. The way you get started is to just do it. Everyone has there preference, but I highly recommend any DVCS.

http://whygitisbetterthanx.com/

Re:Ask HN: How do I get started with version control? by user0 on Saturday May 22, 2010 @03:16PM (#1370858)
I would suggest trying out bzr as its easy to use and has good integration with launchpad.

The 5-minute tutorial[1] is a good start. You can also look at the quick reference[2], its quite self explanatory.

[1] http://doc.bazaar.canonical.com/bzr.2.1/en/mini-tutorial/ind...

[2] http://doc.bazaar.canonical.com/bzr.2.1/en/quick-reference/i...

Re:Ask HN: How do I get started with version control? by elbenshira on Saturday May 22, 2010 @02:15PM (#1370760)
Re:Ask HN: How do I get started with version control? by BoppreH on Saturday May 22, 2010 @02:09PM (#1370746)
I'm facing a similar situation, but my coworker is suggesting SVN. Should I go along or is there any good reason to start right away with git/mercurial?
Re:Ask HN: How do I get started with version control? by Ixiaus on Saturday May 22, 2010 @02:12PM (#1370754)
If your organization is using SVN stick to SVN because your learning curve will be easier (rather than trying to learn two differen VCS systems).

Otherwise, I highly suggest Mercurial; it "just works", has a powerful feature set, and I like bitbucket.org better than github :)

The debate between bzr, hg (Mercurial), and git can become religious because all the tools are good.

Re:Ask HN: How do I get started with version control? by lenni on Saturday May 22, 2010 @02:56PM (#1370801)
I use Mercurial for my personal one-person projects, too. It does its job well and is very easy to use.
Re:Ask HN: How do I get started with version control? by pingswept on Saturday May 22, 2010 @03:53PM (#1370923)
SVN will work great as long as everyone trusts each other and gets along. In my experience, the biggest problems with SVN are interpersonal. There are other problems too, but control of the source in a big company becomes political fast.
Re:Ask HN: How do I get started with version control? by brazzy on Saturday May 22, 2010 @03:08PM (#1370835)
There are a few reasons why you might want to start out with SVN rather than git:

* It's simpler (though admittedly the complex and confusing features of git really only become relevant when there are multiple developers).

* If you're going to work for corporate clients with their own repositories, chances are very high it's going to be SVN (it's possible to use both via the git-svn tool, but that adds more complexity)

That being said, git does have a number of very nice features that are useful to lone developers as well.

Re:Ask HN: How do I get started with version control? by bradleyland on Saturday May 22, 2010 @03:17PM (#1370860)
If you're eventually going to move to something like Git or Hg, you really ought to skip SVN all together. The concepts you learn in SVN will make Git or Hg seem counter intuitive, and the Git / Hg model is a better way to work once you start using teams.
Re:Ask HN: How do I get started with version control? by brazzy on Saturday May 22, 2010 @03:27PM (#1370874)
My (second) point was that there's a good chance you won't be able to skip SVN anyway.
Re:Ask HN: How do I get started with version control? by ccarpenterg on Saturday May 22, 2010 @02:18PM (#1370765)
Git is neat. This is the first time I use a VCS.

Git community book: http://book.git-scm.com

Re:Ask HN: How do I get started with version control? by zppx on Saturday May 22, 2010 @05:32PM (#1371092)
The best way to get started is using one, pick one and use it, generally when I am learning a new tool I try to get the basics emulating my workflow, i.e. I edit, create, move, rename and remove a couple of text files in the case of a VCS, this also serves when I need to learn the commands and the concepts of a new VCS (I'm a git user, but often I need to work with mercurial or subversion).
Re:Ask HN: How do I get started with version control? by nkm on Saturday May 22, 2010 @03:34PM (#1370887)
Since Coda uses SVN, I would start by learning Subversion and then, when I feel comfortable with it, make the jump to Git.
Re:Ask HN: How do I get started with version control? by Osiris on Saturday May 22, 2010 @01:27PM (#1370667)
I found a really easy way to setup a local version control.

1. Install VisualSVN Server 2. Install TortoiseSVN

Use VisualSVN Server to create a repository and set permissions and TortoiseSVN to manage your files and commits.

For someone that hasn't use version control before, I think it's a really simple solution.

Re:Ask HN: How do I get started with version control? by arethuza on Saturday May 22, 2010 @02:03PM (#1370727)
Why do you even need to install the server if it's a personal project - AFAIK svn works just fine accessing repos on a local file system.
Re:Ask HN: How do I get started with version control? by TrevorBurnham on Saturday May 22, 2010 @06:28PM (#1371182)
I like the Git tutorial embedded within http://railstutorial.org. You learn Git, complete with best practices, while developing a webapp with Rails.

After that, read Pro Git: http://progit.org

Re:Ask HN: How do I get started with version control? by diegob on Monday May 24, 2010 @03:25AM (#1374033)
Project Locker is a good free svn/git provider with private repositories. It also has trac for bug tracking, but I didn't use that much. The site isn't too pretty but you can't beat free!

http://www.projectlocker.com

Re:Ask HN: How do I get started with version control? by techiferous on Saturday May 22, 2010 @03:05PM (#1370824)
The best resource is a person at your side. Pair-program a simple project together and have them show you how to use github or git. If you're in the Boston area I'll help you out.