This is more a question of what is the correct strategy than a "how to" for that I already have the GIT manuals.
I have an Xcode workspace. It contains 3 sub projects.
I have been thinking of creating GIT repositories but was looking for some advice as to what would be the best strategy for setting these up.
For each of the sub projects, I may well have multiple branches and would need to have some control over which version of the shared code would be used for each branch of the the "app" sub project.
At the present, the way in which I incorporate the shared code is by copying a reference to that file into the "app" project. I'm not sure if this is the best way going forward as I'm not sure what will happen if I need multiple branches of the shared code.
If anyone out there has a similar set up and can advise, I would appreciate it.
You should declare the shared code as a submodule.
That way, both apps would reference their own commit of your shared code repo.
If you need to do any modification in that shared code repo, you can go in that sub-directory, make them and commit them, but you will need to go back to the parent repo (one of the apps) and commit as well.
See "true nature of submodules".
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With