开发者

Branch only 1 or 2 files in git for android project

I have an android application targetted at business customers in different countries.

I need to customize the application slightly for these customers. At the moment I created a customization.xml file (string resource under res/values) that will contain these custom fields.

Currently I havent found a way to make these customer dependent (also note that they need to be in xml files).

Can I branch only the customizations.xml and androidmanifest.xml files in git? These files are pretty small, so i can easily maintain them in different branches. However the other changes to the project should be easily pushed to different branches. How would i go about doing that?

Say we have a: default : master branch customer1 : customer1 branch with a different androidmanifest.xml and customizations.xml customer2 : ....

Thanks for your insights. (I'd prefe开发者_Python百科r git to solve this, but if you know another way, please elaborate).


Git is snapshot based and will store the entire tree structure per commit. However, it stores contents based on their hash values. This means your changes will add minimal size to the repository.


you can only branch the full project. however, nobody prevents you from changing just those two files in the branch. you can then simply merge those branches to propagate the changes.


There are two problems you are trying to address here: 1) Optimal versioning strategy for doing releases for different countries. 2) Customer dependent customizations, done by user from the app.

For 1) it is recommended that you create a branch, make necessary changes and do a release from it. That way you will be able to have a clear snapshot of what is in the release in case you need to do bug fixes. It will also adequately address the customization and versioning needs you will have for this.

For 2) loading custom UI for users can be done by prompting the user on first launch of app to select from a set of options. You can then save this in app preferences. Make sure to provide an option to change this in some sort of settings menu.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜