background preloader

Version Control

Facebook Twitter

Xcode 4 User Guide: Managing Versions of Your Project. iOS Quick Tips: Version control and backups with DropBox and Git | App Per Month. Git is an amazing VCS. However, Git by itself is not a backup if you are only using it locally – if your hard drive dies, so does your data. Fortunately, Git’s flexibility lets us do some really cool things, such as push and pull from a ‘remote’ repo on the same machine. When combined with a distributed storage system such as Dropbox, it becomes the perfect tool for the solo developer. Here’s how you go about using Dropbox with Git. This little tutorial assumes that you already have a local Git repository (perhaps created by Xcode). Step 1 is to install Dropbox on your Mac. After the install is complete, you’ll notice that you now have a Dropbox folder in your home directory.

Everything you put in this folder will be magically backed up in the Dropbox cloud. Step 2 is to create a bare Git repository for your project in the Dropbox folder. Git init –bare MyProject.git This creates the Git repository that your work will be pushed to. git remote add origin ~/Dropbox/MyProject.git That’s it! Version Control in Xcode using Git and Dropbox - Gerard Condon's Blog. When I first created projects in Xcode, I just let it take care of the version control for me by creating a Git local repository for my code. This was working fine for me but I could see that in future I would need more flexibility. I think it’s better to build that (and good programming habits in general) in at the start of a project when the codebase is small rather than refactoring down the line when it becomes a bigger problem. One issue is that the local Git repository could only be used by one computer. If I wanted to share this code I would need to switch to using remote Git repositories.

Github (recommended to me by Ian Hennessy) would do the job just fine but the free accounts are limited to public repositories. However for someone like me who is a solo developer, these features don’t add much value. One issue that I think may arise would occur if Dropbox has conflicting edits on the same file from multiple locations. And that’s pretty much it for the initial setup. Using Git with Xcode, Part I. A few years ago I wrote a series of posts about getting Subversion working with Xcode. Now that the latest versions of Xcode now support Git, I figured I would put together a tutorial about getting Git working with Xcode. Having worked with Git for only a short while, I find it is a much easier source control management system to work with compared to Subversion and others. Getting Started with Git If you are brand new to Git, you can get a quick overview of the product and download it by visiting the Git official website. Creating a Local Git Repository for NEW Xcode Projects The easiest way to put a new Xcode project under version control within Git is to select the Create local git repository for this project check box when creating your project in Xcode.

Creating a Local Git Repository for Existing Xcode Projects To add an existing project to a new local Git repository will require you to use the command line. Here is a sample .gitignore file for Xcode projects: build/ xcuserdata 1. 2. How to Create Git Repos for Existing Xcode Projects » Ash Furrow. Game & Code • Using Xcode 4 with Github. 12 steps to using GitHub with XCode 4 | dev:ices. The Git integration in XCode 4 is very welcome however it seems to be a bit flaky when it comes to dealing with remote repositories. For clarity I’m using Mac OS X version 10.6.7 and XCode 4.0.2 (4A2002a). If I create a new XCode 4 Project and accept the option to create a local Git repository, all is well. I can commit locally and that’s great. When I want to push the new project to GitHub I want to add a remote repository and push my local changes up to GitHub. I can add a GitHub repository to XCode 4 as a new Repository in the Organizer window but there’s no method of setting it as a remote repository for my existing project.

So instead here’s the 12 steps that I followed to get GitHub to work with a new XCode 4 project Launch XCode 4Select the ‘Connect to a repository’ option from the ‘Welcome to XCode’ dialog.Paste in your GitHub SSH URL in the Location text box. Git - In XCode 4 how do I add a remote GitHub repository to an existing local project.