4

I'm an iOS developer looking to better manage the projects I am creating. I've never touched SCM before so I'm not sure which system to use.

I'd like to keep track of changes to the different apps I'm making for my boss, but also have them in a centralised place, and be able to branch off and be working on features separate from the main app and then merge the changes back in when I'm finished. All of this will be done locally (stored on an external hard disk in my office), and once versions are complete I'd like to be able to export a copy without the SCM features to send to my boss.

I've just upgraded to Xcode 4 and noticed Git is built in. I played around with both Subversion and Git, but it sounds like Git is what would fit my needs better. However, it seems to be totally different to Subversion. The Xcode 4 documentation suggests Git is best for lone developers, but that doesn't seem the case. If the git repository is inside your working copy, how on earth do you make branches of it? Where do you send your changes to? Do you copy the entire working directory and use that as your branch?

Just looking for someone to explain in plain english which SCM system would be best for a lone developer to use and any tutorials people may know of to help me understand it.

Thanks for any help!

ThisDarkTao
  • 1,062
  • 10
  • 27
  • For anyone else visiting this question and still wondering which one to use, definitely use Git, without any doubt. After getting to grips with it and learning all the features it is the only SCM system that makes sense! – ThisDarkTao May 22 '11 at 20:24

2 Answers2

4

Go for git!

The repository actually resides in your working directory. There is .git folder which contains all the data about your branches and commits and whatsoever. You can create a bare repository(only the contents of the .git folder) if you like but having both in the same place is nice, especially if you are a single developer who doesn't need distribution.

Branching in git is very easy:

# create the branch
git branch mybranch

# switch to branch
git checkout mybranch

# show branches
git branch

Git does not depend on a server like svn does. You can have distributed development by using remotes but this is not necessary.

If you like to make a copy for your boss without the git files in it do a

git archive branchname --format=zip -o tree.zip

I suggest some reading on git

Nick Weaver
  • 47,228
  • 12
  • 98
  • 108
  • That definitely seems a lot easier than svn! I was watching the Google session where Linus talks about Git and it actually makes a lot of sense! I'll read your links and Ikke's link too. Sorry I'm very new to this site, is there a way I can contact you directly if I need any more info? – ThisDarkTao Apr 15 '11 at 14:54
  • Just a question for you Nick that wasn't readily explained in any of the links. In Subversion, when you make a branch, you checkout the branch and have a working copy to make the edits with. Using Git, when I have a branch and switch to it using git checkout, does the working copy where .git resides change to reflect the branch I'm working on? Thanks! – ThisDarkTao Apr 16 '11 at 15:01
  • Yes of course. By branching and checkout you switch your working tree to the branch. By default it take the starting of where you left your previous branch. In git everything is a branch. – Nick Weaver Apr 16 '11 at 15:10
  • Thanks again Nick, got my head around it and now have projects under Git versioning control :) – ThisDarkTao Apr 18 '11 at 18:18
  • Nice, may I suggest this link to improve on merging files? Even if you are single developing, [this link](http://stackoverflow.com/questions/255202/how-do-i-view-git-diff-output-with-visual-diff-program) may be interesting: ` – Nick Weaver Apr 18 '11 at 21:30
3

Branching in git is very different from SVN. Branching happens in place, in stead of in another directory.

Read this book and other resources to get a better understanding about how git works

About the centralized server, Git is a decentralized SCM. That means that every clone contains the entire repository, not only the current working directory.

That doesn't mean you can't have a central repository. On the central server you create a bare repository, and on you're local machine you clone from that repository, push and pull from that repository, often through ssh.

Ikke
  • 99,403
  • 23
  • 97
  • 120