Version control provides a number of benefits to the developer. Here are some of those benefits:
Imagine working on a piece of code. Let's call this version 1:
var eureka = "The meaning of life is the following number" var meaning_of_life = 42 print("Guys, I've figured it out. \(eureka) is \(meaning_of_life)!")
Then after a few days, you change your mind and update the code. Let's call this version 2:
var eureka = "The meaning of life is the following number" var meaning_of_life = 99999 print("Guys, I've figured it out. \(eureka) is \(meaning_of_life)!")
Some time passes, you close Xcode, shut down your computer and then you realize:
The first version was right! What did I have?
With Git, you can have a historical record of all changes made in your code. You can then reference those changes at a later time.
var meaning_of_life = 42
Now imagine you are working with a team of three programmers on an awesome new app. There is one Xcode project, three programmers and one manager.
The benefits you get with a version control system, such as Git, in this scenario:
Branches are commonly used to segregate new code from the existing project. Let's say your manager decides she wants to incorporate a new feature into your awesome app and only wants that feature to be available to the rest of the developers when it's complete and ready.
With Git you can work on your own branch and incorporate your changes at a later time, while retaining the other benefits of version control, as previously described.
When you're working with Git, you are working with your own copy. This is what we refer to as your local copy. With your local copy, you can do whatever you want. Add some new buttons to your app, change todo en español, get dangerous and experiment and tinker throughout the app.
This is a great way to learn and experiment
This is your local copy and you're not affecting others. You can commit changes to your local copy (even without Internet access) and decide to abandon it all and get a fresh copy from the remote.
When you're ready, you can publish your changes from your local copy into the remote repository.
Why Git? - http://www.markus-gattol.name/ws/scm.html