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

MacMan988

macrumors 6502a
Original poster
Jul 7, 2012
890
165
Hi, I've been reading about the snapshot feature in Xcode and the ability to create local git repositories. Are those two things the same? If not, aren't they supposed to do the same thing? Which method is more reelable when it comes to having previous "known good states" of the project?
 
They have some overlapping purpose, but they aren't the same and they weren't made to solve the same problems.

Git allows you to do things like merge multiple commits together. This means that if you're on a team of 2 or more people, everyone can edit the same files and then have all their code merged together.

I'd suggest learning how to use git properly. Don't use a git program with a GUI - those are inevitably too magical and then break and leave you in a state where you don't know what to do. Just use git from the terminal.
 
Thanks for the reply. I'm a bit familiar with SVN and the concept behind it. Haven't used git before though. I'm gonna take your advice and get familiar with using git through the terminal.
 
Hi, thanks for the reply. I followed the guide you have posted and some more tutorials and got my Xcode linked with a GitHub repo too. Although, one thing that that I couldn't find is how to create a gitignore file and add it to the GitHub repo. How do I add a gitignore file to the GitHub repo? Should this be done at the initial commit? What if I add the gitignore file at a later point?
 
Hi, thanks for the reply. I followed the guide you have posted and some more tutorials and got my Xcode linked with a GitHub repo too. Although, one thing that that I couldn't find is how to create a gitignore file and add it to the GitHub repo. How do I add a gitignore file to the GitHub repo? Should this be done at the initial commit? What if I add the gitignore file at a later point?

You can add gitignore later, the problem is that if you already uploaded files that should be ignored, it's a pain to get them removed from the repository. It's best if you handle the gitignore from the very beginning. Make sure to remove videos - those are huge and nearly useless on git, and will very quickly eat up your available space on GitHub.

(I accidentally uploaded a 10 minute video to GitHub at work one time. Nobody was able to access GitHub within the office for ~15 minutes while it uploaded. It was embarrassing to admit that I caused that problem. So consider yourself warned now).
 
You can add gitignore later, the problem is that if you already uploaded files that should be ignored, it's a pain to get them removed from the repository. It's best if you handle the gitignore from the very beginning. Make sure to remove videos - those are huge and nearly useless on git, and will very quickly eat up your available space on GitHub.

(I accidentally uploaded a 10 minute video to GitHub at work one time. Nobody was able to access GitHub within the office for ~15 minutes while it uploaded. It was embarrassing to admit that I caused that problem. So consider yourself warned now).

If the files that should be ignored are committed to the local git repository, but then the gitignore is added later but before pushing the first initial commit to GitHub, are those files gonna be added to the GitHub anyway because they are already in the local git repository ?
 
If the files that should be ignored are committed to the local git repository, but then the gitignore is added later but before pushing the first initial commit to GitHub, are those files gonna be added to the GitHub anyway because they are already in the local git repository ?

Yes.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.