Reputation: 1393
I know this sounds a little bit odd but I'm really struggling with this situation and git branching
is not the answer.
I have a situation that I need to keep my android source code in different versions. But the problem is some part of the code is common in these versions but some are not since they are files and edits based on different android market standards; they need to be different.
So I need to find a way to keep my source code in different versions and as I'm editing code, these common differences take effect in all versions but as I'm editing the different files and contents (Ones related to the markets) I need them to only effect and be added to their own version.
P.S: I cannot use git branching since I need to keep track of each and every version changes with commons and differences all the time and its not a logical approach cause it may cause problems.
P.S: I need to find a way to configure something like gitignore
to approach this task and make git push commons and differences to their related versions.
P.S: If any other VCS or program helps to approach this I'd be glad to know.
Upvotes: 2
Views: 154
Reputation: 38106
Git branching can meet your requirements.
Assume there are two market standards you need to work on, so you can manage your source code in three branches:
common
branch: manage the versions for the common files. With .gitignore
to match all the possible non common files so other branches merged in the common
branch, the non common files won’t be tracked.market1
branch: manage all the source code in market1 standard. And the non common files for market1 standard only managed in market1
branch.market2
branch: manage all the source code in market2 standard. And the non common files for market2 standard only managed in market2
branch.The workflow shoule be:
common
branch, if you want to update the common files in the different markets branches, you can merge common
branch directly into the markets branches separately.market1
branch. If you changed the common files in market1
branch, you can update the version in common branch by merging market1
branch into common
branch (the non common files won’t be added in common branch since it’s match in .gitignore
).market2
branch. If you changed the common files in market2
branch, you can update the version in common
branch by merging market2
branch into common
branch.Upvotes: 0
Reputation: 93561
Use different projects. Make your common parts a library, and then make different projects which include that library. Then you can have it in one repository. Alternatively, you can put them in different repositiories and use a git submodules to link between them.
Upvotes: 1