开发者

Which SCM system to use with Xcode 4 for a lone developer?

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 yo开发者_运维知识库ur 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!


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

  • Git in five minutes
  • Git Community Book
  • The Thing About Git


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜