Help Setting Up Version Control

"Please leave a message at the beep, we will get back to you when your support contract expires."

Moderators: phlip, Moderators General, Prelates

User avatar
xulaus
Posts: 136
Joined: Thu Jul 03, 2008 11:09 am UTC

Help Setting Up Version Control

Postby xulaus » Sat Jul 06, 2013 5:45 pm UTC

Hello there forumites,

I've been hobby programming for quite some time, but I've only ever used flat files (with some backups) for source control and I've honestly never had a reason to change from that. However, in the not too distant future I am going to be programming with a friend on a joint project for the first time and I figure now is probably the best time to switch before bad habits become ingrained again.

I've done some research and Bazzar seems the most newbie friendly, but I can't find a guide to set it up. Can someone link me to a hand-holdy guide (or be willing to write on) for me?

Thanks :).
Meaux_Pas wrote:I don't even know who the fuck this guy is

User avatar
Thesh
Made to Fuck Dinosaurs
Posts: 6301
Joined: Tue Jan 12, 2010 1:55 am UTC
Location: Colorado

Re: Help Setting Up Version Control

Postby Thesh » Sat Jul 06, 2013 6:43 pm UTC

If you are a newbie to version control, you might want a more popular tool as it will be easier to get help just due to a larger community. Mercurial is widely considered easy to use, however, I personally found Git to be more intuitive (and I am probably in a very small minority here). Either way, if you are using Windows, there are shell extensions for all three (TortoiseHg, TortoiseGit, TortoiseBzr) that you might find easy to use. That said, you might give all three a try and then decide which you like best?

I found this quick tutorial on Bazaar which is probably enough to get you started:
http://doc.bazaar.canonical.com/latest/ ... -tutorial/

There's also a good guide if you decide to use Mercurial:
http://hginit.com/

And this is the official Git tutorial:
http://git-scm.com/docs/gittutorial
Summum ius, summa iniuria.

User avatar
xulaus
Posts: 136
Joined: Thu Jul 03, 2008 11:09 am UTC

Re: Help Setting Up Version Control

Postby xulaus » Sat Jul 06, 2013 7:09 pm UTC

I had looked at that bzr tutorial, but it seems to only go over the very basics and nothing much about sharing changes or setting up a server (if that's what's needed); The more advanced tutorial just jumps right in with technical jargon, so that's no good either. Thanks for the tipoff about Hg though, the documentation does seem to be more clearly written so far. I'll have a read and report back :)
Last edited by xulaus on Sun Jul 07, 2013 12:32 am UTC, edited 3 times in total.
Meaux_Pas wrote:I don't even know who the fuck this guy is

User avatar
Thesh
Made to Fuck Dinosaurs
Posts: 6301
Joined: Tue Jan 12, 2010 1:55 am UTC
Location: Colorado

Re: Help Setting Up Version Control

Postby Thesh » Sat Jul 06, 2013 7:18 pm UTC

For all three, you can just access the repo over SSH. Git comes with a daemon as well, but I don't see any advantages over SSH.

I found this guide for Bazaar:
http://doc.bazaar.canonical.com/bzr-0.11/server.htm

It's literally one command to add the remote SSH repo.
Summum ius, summa iniuria.

User avatar
xulaus
Posts: 136
Joined: Thu Jul 03, 2008 11:09 am UTC

Re: Help Setting Up Version Control

Postby xulaus » Sat Jul 06, 2013 8:40 pm UTC

I wasn't sure if I need a server though, thats why "if it's needed" was in there. But anyway the Hg docs were clear as glass, so I got a repo up and running in about 5 seconds and was branching and all the good stuff within the hour. For my partner it looks like I can just shove the folder, .hg/ and all, in dropbox and we can both write to it, if that's right?

EDIT: Actually I think we may be able to deal with just hg export. Thanks for the help though!
Last edited by xulaus on Sun Jul 07, 2013 12:32 am UTC, edited 1 time in total.
Meaux_Pas wrote:I don't even know who the fuck this guy is

User avatar
Thesh
Made to Fuck Dinosaurs
Posts: 6301
Joined: Tue Jan 12, 2010 1:55 am UTC
Location: Colorado

Re: Help Setting Up Version Control

Postby Thesh » Sat Jul 06, 2013 9:08 pm UTC

If it's only two users, you can use a service like Bitbucket, which is free for up to 5 users, and is designed specifically for repo hosting.

https://bitbucket.org/
Summum ius, summa iniuria.

User avatar
scarecrovv
It's pronounced 'double u'
Posts: 674
Joined: Wed Jul 30, 2008 4:09 pm UTC
Location: California

Re: Help Setting Up Version Control

Postby scarecrovv » Sat Jul 06, 2013 10:36 pm UTC

Since you seem to be interested in not forming bad habits, Hg is the correct way of shortening Mercurial, not Mg (which would be Magnesiumal).

Also, the only version control system that I both know well and would recommend is Git*. Here are some resources for learning about Git, if that's what you choose to do. Also GitHub is a very good repository host, which I highly recommend.

* I do not know Hg or Bzr well.

User avatar
xulaus
Posts: 136
Joined: Thu Jul 03, 2008 11:09 am UTC

Re: Help Setting Up Version Control

Postby xulaus » Sun Jul 07, 2013 12:35 am UTC

Thesh wrote:If it's only two users, you can use a service like Bitbucket, which is free for up to 5 users, and is designed specifically for repo hosting.


Yeah after even a modest google there seems to be a butt-tonne of these services out there. Yet more research and decisions to be made I guess. But seriously, thanks for all your help :).

scarecrovv wrote:Hg is the correct way of shortening Mercurial, not Mg


Don't know what I was thinking there. Major brain-fart. I've corrected it now.
Meaux_Pas wrote:I don't even know who the fuck this guy is

beojan
Posts: 166
Joined: Mon May 23, 2011 12:11 pm UTC
Location: Oxford / London, United Kingdom, Europe

Re: Help Setting Up Version Control

Postby beojan » Tue Jul 09, 2013 9:50 am UTC

Bazaar is really quite specific to Ubuntu, so unless you are developing for ubuntu alone (in which case, if you use Launchpad, bazaar is a good choice), I wouldn't use bzr.

Git appears to be used a lot more than Hg, and you can host your project on github.

xulaus wrote:I wasn't sure if I need a server though, thats why "if it's needed" was in there. But anyway the Hg docs were clear as glass, so I got a repo up and running in about 5 seconds and was branching and all the good stuff within the hour. For my partner it looks like I can just shove the folder, .hg/ and all, in dropbox and we can both write to it, if that's right?

EDIT: Actually I think we may be able to deal with just hg export. Thanks for the help though!


Git, and I think Mercurial, are distributed version control systems, so you don't need a server, so long as you can each connect directly to the other's computer. Using a version control system, then sharing the folder over dropbox, completely defeats the point of using a version control system in the first place, and reduces it to purely a snapshot backup system. What you should be doing is pulling from and pushing to each other's copy of the repo. See http://software-carpentry.org/4_0/vc/index.html (although this uses svn, which is not distributed version control).

EvanED
Posts: 4331
Joined: Mon Aug 07, 2006 6:28 am UTC
Location: Madison, WI
Contact:

Re: Help Setting Up Version Control

Postby EvanED » Tue Jul 09, 2013 6:20 pm UTC

xulaus wrote:I've been hobby programming for quite some time, but I've only ever used flat files (with some backups) for source control and I've honestly never had a reason to change from that.

Yeah you did, you just never realized it. :-)

I would also recommend Git or Merucrial. I use Git and have concrete reasons why I prefer it (e.g. the index is great and Hg's approximations to it are only so-so), but either will serve your purpose well.

beojan wrote:Git, and I think Mercurial, are distributed version control systems, so you don't need a server, so long as you can each connect directly to the other's computer.
You don't need a separate server, but it's not really a stretch at all to say that if you can connect directly to each other's computers, both computers are servers. You need to make sure that you can connect through your cable modem (I think this isn't likely to be a problem), any router you may be using (if you have one, probably requires specific setup unless you've done it before), you have an SSH or other daemon running with a hole punched through the firewall, and you need to leave your computers on during time periods where the other will want access. And you'll probably be violating the TOS for your Internet connection, in the off chance you care.

IMO, using a free service like Bitbucket or GitHub is way easier.

Using a version control system, then sharing the folder over dropbox, completely defeats the point of using a version control system in the first place, and reduces it to purely a snapshot backup system.
So first, a snapshot backup system is a large part of what version control gives you, so it doesn't defeat "the" point of using version control because there are (at least) two points and it only defeats one of them.

Second, it's totally possible to put the primary repository into Dropbox and still clone it locally and work from it, and that may not be a bad way to go. I'd still favor something which specifically provides version control though. I can imagine that there are some locking or other synchronization that won't work correctly with Dropbox, though it seems somewhat unlikely.

However, despite my first point above, beojan is right about one thing: if your setup has a bunch of source files in Dropbox and both you and your friend are editing them, you're doing it wrong. :-) If you go the Dropbox route, the only thing that should be shared is a bare repository. (With Git you create it with git init --bare inside the Dropbox folder; with Mercurial, do hg update null after making the repository.)

What you should be doing is pulling from and pushing to each other's copy of the repo.

A rule of thumb is that you should only push to a bare repository (see above, and consider any Github/Bitbucket/etc. repos to be bare), so if you go the route where you and your friend both make your local repositories available to each other, you'll probably only pull.

See http://software-carpentry.org/4_0/vc/index.html (although this uses svn, which is not distributed version control).
[shameless plug]I have a document describing version control relatively neutrally, and equally applicable to distributed and centralized, here. It is a little specific to our environment, but not much; ignore stuff that talks about the "CSL".[/shameless plug]

User avatar
xulaus
Posts: 136
Joined: Thu Jul 03, 2008 11:09 am UTC

Re: Help Setting Up Version Control

Postby xulaus » Sun Jul 14, 2013 8:38 am UTC

Thanks for all the advice folks. I was just talking about putting a copy of the repo in dropbox to avoid dropbox doing its own version thing, sorry I didn't make that clear. But I guess if there are free hosts out there then its all a moot point anyway. No point using a hammer for a screw.
Meaux_Pas wrote:I don't even know who the fuck this guy is


Return to “The Help Desk”

Who is online

Users browsing this forum: No registered users and 5 guests