Backing Up Xcode Projects

I have a few questions.


What would happen if something happened to my iMac? What if my Xcode projects somehow got corrupted? What's the best way to back up my projects in case something like that happens?


Thanks,


John K.

Accepted Reply

What would happen is the same thing that would befall any data if your mac goes down. You either lose access to your files until you can effect repairs, or lose them completely if you don't have a tested and reliable backup you can restore from.


At a minimum, many devs rely on a Time Machine backup, and/or source control via Xcode...see Xcode Help for detail on the current process.

Replies

What would happen is the same thing that would befall any data if your mac goes down. You either lose access to your files until you can effect repairs, or lose them completely if you don't have a tested and reliable backup you can restore from.


At a minimum, many devs rely on a Time Machine backup, and/or source control via Xcode...see Xcode Help for detail on the current process.

Thank you! Is there anything else I should do just to be safe, or is the Time Machine as good as it gets excluding preference?

In addition to backups, I highly recommend you use source control management (SCM) for your projects. Using Git SCM plus a web service (GitHub, GitLab, or BitBucket) not only keeps your project backed up online, but also keeps a history of your project's files. The history is useful in case 1) you need to see what you changed or 2) you want to undo a change you made.


Here's information for source control in Xcode: https://developer.apple.com/videos/play/wwdc2018/418/


As far as a web service, I would recommend GitLab.com if you are just starting out. It allows you to store an unlimited number of private projects: about.gitlab.com

Is it possible to add SCM to an existing project?

Yes. In Xcode, select Source Control > Create Git Repositories. It can also be done manually from the command line with

git init
.

Would you recommend using GitLabs or something similar?

GitHub is the most popular (especially for open source) but only offers free public repositories. GitLab and BitBucket both offer free private repositories. I personally use GitLab because I like its interface better than BitBucket's.

Alright, thanks! Before I make a (GitLab) account: My stuff is 100% secure, right? Nobody else can access it?

Nothing is 100% secure. I have a strong password, and GitLab uses the recommended security practices. So GitLab is definitely secure for my purposes (storing the proprietary source code of my apps). If you are interested in the details, see their security and privacy policies: about.gitlab.com/security/ and about.gitlab.com/privacy/