I have my App published as a free and pro version to the android market. All sourcecode is stored in one git repository.
I now want to publish the app to another app market. Since only a few files will change (Android Licensing) I'm thinking about what would be the best way to archive this.
One way would be Android Library Projects, I think. But can I archive a similar effect by using git, so that I habe two repositories which share one codebase and do only differ by a few files? Since I'm currently not that familiar with git, please explain precisely what I need to do or where I need to pay attention to.
Thanks.
Using one git repo for all variations of an app is how I store mine. For example, one of my apps has a free and a pro version, and is available on both the Android market and the Amazon app store. In git, I have 3 branches:
Master is the free version, pro is the paid version on the Android market, and amzn is the free version on the Amazon app store.
I do all my feature changes in master. Once I'm ready to do a release, I build and test the free version, then tag master with the release number. I then switch over to pro, and run a git merge master to bring in all the new changes.
Since pro is a paid version, When I first branched from master, I commented out the ad related code (since it was only a few lines, I didn't think any refactoring was necessary), and changed any strings to refer to "Some App Pro" instead of just "Some App".
During the merge, I typically don't have any conflicts, and that original modification is maintained. but if not, it's pretty easy to resolve the conflicts and get the pro branch back to being ad free.
Likewise for the amzn branch, I originally removed any references to Google's market, and do a merge from master whenever I'm ready to release.
Then for both pro and amzn, I can build test and tag.
To keep package names unique (which I'm not actually sure is a requirement or not), I first took my Activities and moved them to new packages, ie com.whatever.free.appname, com.whatever.pro.appname...