When you submit an app to the app store for review, what do you do?
Do you simply stop development on the app until the review comes back? Do you keep working on new features? If your app is denied, do you try to resubmit it with the new features you added since the first submission? Do you try to undo everything you did, fix the issues found in the review, and resubmit? Do you switch over to another app?
The app store review process causes some interesting workflow challenges, but git makes them easy to deal with.
Let’s assume that you’re already using Git and Dropbox (or some other DVCS such as mercurial, and some other form of backup or a networked repository). If you aren’t, you should be, so stop reading this article and go read this one instead.
Let’s also assume that you are familiar with basic DVCS concepts such as branching, merging, and tagging. If you aren’t, the git book is a great place to learn.
So, we are ready to start working on some cool new features. We’ll start by creating a branch for our next version – in this case, version 1.3.
Martys-Mac:WhichEpisode marty$ git checkout -b 1.3 M Which Episode.xcodeproj/project.xcworkspace/xcuserdata/marty.xcuserdatad/UserInterfaceState.xcuserstate Switched to a new branch '1.3'
Now we’re ready to make our changes. We’ll fix a few bugs, add some features, tweak some views, and so on. This might take a few commits – that’s totally fine.
...make changes... git commit -am ... ...make changes... git commit -am ... ...make changes... git commit -am ...
Ok, we’re now done version 1.3, and we’ve uploaded the binary to the app store for review. Time to end our work on the 1.3 branch by merging it back in to master, and then pushing our changes to our repo in DropBox. You can also push to your remote repo for safekeeping at any point during development of 1.3, of course.
Martys-Mac:WhichEpisode marty$ git checkout master Switched to branch 'master' Martys-Mac:WhichEpisode marty$ git merge 1.3 Updating 41988bd..90adff4 Fast-forward Default-Portrait@2x~ipad.png | Bin 0 -> 18121 bytes Default-Portrait~ipad.png | Bin 0 -> 5949 bytes Martys-Mac:WhichEpisode marty$ git push Total 0 (delta 0), reused 0 (delta 0) To /Users/marty/Dropbox/Projects/WhichEpisode.git/ 41988bd..90adff4 master -> master
At this point, the branch for 1.3 is still there, but we won’t need to touch it again unless something goes wrong with our submission. However, we are ready to work on our next release, 1.4, so let’s create another branch for it:
Martys-Mac:WhichEpisode marty$ git checkout -b 1.4 Switched to a new branch '1.4'
You can now start working on all the cool new features for your next release.
If 1.3 gets rejected, and you need to apply a fix to it, just switch to the 1.3 branch, make the change, and commit it.
Martys-Mac:WhichEpisode marty$ git checkout 1.3 Switched to branch '1.3' ...fix bug... git commit -am ....
Re-submit the binary, then switch back to the 1.4 branch and merge in the change, to make sure it stays up to date with any important fixes.
Martys-Mac:WhichEpisode marty$ git checkout 1.4 Switched to branch '1.4' Martys-Mac:WhichEpisode marty$ git merge 1.3 Updating 90adff4..3152f6d Fast-forward 0 files changed create mode 100644 test.txt
Astute readers may notice that at this point, we have a change in the 1.3 branch that’s not in master. I can live with that, because I know the change will find its way to master once the 1.4 branch is merged, but if you are really worried you can always merge 1.3 to master again.
Martys-Mac:WhichEpisode marty$ git checkout master Switched to branch 'master' Martys-Mac:WhichEpisode marty$ git merge 1.3 Updating 90adff4..3152f6d Fast-forward 0 files changed create mode 100644 test.txt
So, that’s pretty much how I use git to work with the app store release process. It lets me submit releases to the app store for review, and then continue development in another branch, without worrying about what to do if my app gets rejected.
This has been working quite well for me, but I am curious as to what everyone else does. Thoughts? Ideas? Ways to improve the process? Do something completely different? Use git-flow? I would love to hear your stories!