Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

moonman239

Cancelled
Original poster
Mar 27, 2009
1,541
32
I lost some progress due to a change that I decided to make, and I don't want that to happen again. Therefore, I suppose using Source Control would be a good idea. However, I just want code that works as I want it to to be in the project's repo. That way, if I ever end up breaking what previously worked, I can go back to the latest working copy.
 

MattInOz

macrumors 68030
Jan 19, 2006
2,760
0
Sydney
If your using a repository like Git you can branch the code at any point. I think the aim is to get the habit of keeping the main branch for working version then remembering to create a new branch anytime you go and change anything.

Then when you have it working again in the branch you fold it back in to the main code branch.

If it turns out the idea you were trying didn't workout you discard the branch.

You also have the option to selectively submit code changes to repository.
 

moonman239

Cancelled
Original poster
Mar 27, 2009
1,541
32
If your using a repository like Git you can branch the code at any point. I think the aim is to get the habit of keeping the main branch for working version then remembering to create a new branch anytime you go and change anything.

Then when you have it working again in the branch you fold it back in to the main code branch.

If it turns out the idea you were trying didn't workout you discard the branch.

You also have the option to selectively submit code changes to repository.

How do I do that?
 

Dekard

macrumors 6502
Sep 7, 2011
394
2
Dallas, Texas
Is there any decent frontends for git? I've worked with 1 other developer before using git and it works pretty well, but I just got done with Subversion/Cornerstone and it was terrible trying to work with others.. Currently looking for a decent solution for small teams..
 

mfram

Contributor
Jan 23, 2010
1,307
343
San Diego, CA USA
Well, you read about how Git works. It's not magic. You have to specifically decide when your app is "working" the way you want, then you commit it to the source control history. Think of it as a checkpoint. You can go back to that commit later or you can branch off from any commit you've made. The XCode UI presents some thing you can do with git, but not necessarily everything. You may have to use the command-line version to do more advanced git operations XCode doesn't implement.

When you start a new project XCode gives you the opportunity to create a new git repository. If you already have a project going, then you can still start using git, but you may have to initialize the reposity on using the command-line. I'm not sure.

----------

Is there any decent frontends for git? I've worked with 1 other developer before using git and it works pretty well, but I just got done with Subversion/Cornerstone and it was terrible trying to work with others.. Currently looking for a decent solution for small teams..

I just started using git with XCode sync-ing to a remote respository. It seems to work pretty well. git can be a little challenging to use with a team until you understand it's model of how source control works. It's not a central checkout type model. Instead, it's a distributed patch-sharing model. Both have their plusses and minuses.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.