GIT separating 1 project into the 2 - android

I am working in some project for mobile devices. Soon it will be separated into the two projects with the same code but another one will be for AndroidTV.
So how we should build git logic, when I am working with mobile project and the other programmer working with my code, but adapting it for AndroidTV?
My ideas:
We need to have two different branches in repository. One for mobile and one for AndroidTV. So before the other programmer will be comitting and pushing his changes to his branch, first he must make "Pull" from my branch and then Commit and Push to AndroidTV branch.
Am I right? If no, please upgrade my ideas.

Related

How to manage a SaaS project

We have a repo that contains a Base code for a React Native App (SaaS)
In the same Repo, We have multiple branches for every client (separated app)
Master contains the main base code (we push any new features/ fixes to it)
Now we have issues when want to push the new features/fixes to other branches! It's about changing the package name and icons etc (native stuff). When open PR to take updates from master => client-1.
So do you recommend any tips that help us to manage all fixes/features in the base code and applying it to other branches without effected by iOS/Android things?
This is potentially an insufficiently specific question but, I'll try to help.
The way I'd approach this is just having develop, staging, and main branches, so I can minimize the conflict potential. In what I assume is a monorepo, I'd then be able to accomplish having base changes get to the client apps in some orchestrated manner, via localized package management by way of leveraging Lerna or Yalc, plus a CI/CD step. In effect, I'd have any changes to base cause an associated version bump of "base" in the dependent clients, and a rebuild + release of those clients.

Workflow process with two different mobile app from the same git repo

We have two different mobile apps (pretty similar with a few changes, but this is two different apps on the app store). Theses two apps are build from one git repo (xdode allow us to share the code with different schemes and we have the equivalent for android)
I'm designing a git workflow process to the team and i was planning to use gitflow with a few modifications to fit our needs. But i'm stuck with this two applications in the same git repos and i'm not sure if we should keep it like this and having two app with two differents version on the same git repo, or if separate them in two repos could be a better choice, knowing that most of the time, the new feature will have to be integrated in the two applications.
My principal concerns about this is that the workflow could become too complex and the git history really messy, not easy to read.
Do you think separate this applications could be a good choice ?
maybe you can use git submodule to help.Make the common part a submodule and then you'll have 3 repos.
When you want to share code from one app to another, just move the code to the submodule.
Git Submodule Documentation

Git work flow for apps with common functionality

I am seeking a solution for setting up a git workflow for our team. We are developing native IOS and Android apps. there will be a master project (for each platform) that will contain all the all the core functionality and then a version of the master will be customized for each customer. We need to make bug fixes and changes to common functionality in the master project and these apply to each customized customer build. Changing each customer copy would be unsustainable.
I am currently using a branch for each customer and all common functionality is edited in the a "base branch" but this approach seems messy.
Edit
the main problem i am having with this is when i make changes to the the template project is i was told to "merge" only specific files i would have to checkout the file from one branch to the others (client branches) but this would then over right client specific changes.
Any help would be greatly appreciated.

Git. Store several projects under the same repository

Imagine mobile application that is planned to be implemented for both iOS and Android.
Development was started from the iOS version only and now the time has come to start with Android one.
iOS application's code is stored at its' own Git repository that named after the apps name, e.g. "MYApp".
Now I would like to create one common repository for both iOS and Android applications and name it again after application's name: "MYApp".
It is not a problem at first glance.
Just create repository, create 2 subfolders there and start working.
But.
I would like that Android developer could work only with his folder and iOS developer only with his one too and both of them could see only their own folders related history (log).
I worked with SVN previously.
Usually I created subfolders and you could checkout any of them to work only with this subfolder.
History was also filtered to your scope.
I'm stuck with implementing the same under Git.
Please, help me to find right direction.
I will sum up solutions suggested.
Use branching for different platforms. I don't think that it is good idea, because branches used for another purpose. It seems to me very "jacky".
Use submodules. Just create as many repos as platforms you are targeting to, name them "MYApp-iOS", "MyApp-Android", etc. and finally end up with "master" repo, that could be names as "MYApp" (without any suffixes). Then add all related repos to "master" one with git submodules feature.
Use git slave. Investigating...
Please, feel free to edit this list to brainstorm the problem.
There is a way to keep to kind-of-related separate projects in a same git repository utilising git branching.
But keep in mind that that is not why branching was implemented into git. One of its uses would be development of a radical new functionality to your app that might not see the release any time soon for example.
On the end: it is a matter of opinion. If you are prepared to administrate a more complex repository just to keep both codes on the same place - you can.
I would definetly make two separate repositories though. Couple of opinions on this topic can also be found here on SO: Git branches with completely different content
EDIT:
gitslave seems to tackle your problem. You might want to give it a try.

proper git branch for an Eclipse Android codebase

I have an Android project in Eclipse which I've used git for revision control. The project is built around an sqlite database and I've named the project com.lsp.rengine.
I now want to create a second application using a different set of data. I can basically copy the new database over the top of the existing one (in assets/) and things work fine. I will need to change some icons and layouts however, so thought a simple git branch would get me on my merry way.
There are a few show stoppers which are stumping me. For one, I can't install both applications on the same device as they currently share the same com.lsp.rengine name. If I refactor the project name to com.lsp.pengine, my upstream branch thinks all the shared code has disappeared.
How can I manage Eclipse, the two branches in git, and still have shared codebase (update master codebase, changes are reflected in both branches) and somehow have two separate install locations?
I think the best approach would be to refactor your code into two separate Android projects with a third library project containing all the shared code. The TicTacToeMain and TicTacToeLib sample projects should be able to help you get started.

Categories

Resources