We have written an angularjs web site/app - optimised for mobile
and are using cordova to make an html5 based mobile app.
The code (html, css, js) will be the same for both the web app and cordova app
but there will be some files that will be different.
How do we set up our git repo to share (only) common files between the web-app repos and the cordova-app repos ?
Obviously any .gitignore
files are tracked and are common to all repos. We could add all files we don't want in the cordova repo to .gitignore
but that will reduce the usability of 3+ web app repos for the one cordova repo.
We've tried:
Having a local repo of the project for the cordova app with .git/info/excludes
on that repo instead of .gitignore
files - but this only solves the problem for pushes from that repo, not pulls from the origin (which will cause errors with untracked files)
Setting up a different branch - and use a git flow style approach for intermediate branch for merges - but it's (apparently) not possible to have an .git/info/excludes
specific to a branch - so everything will get overwritten on each merge
I would need more informations about the project because it could depend of a variety of factors: goals, time, budget, etc... But in my opinion there are much more differences than only "some files" between a web and mobile projects. For example:
For this I would create three separate repositories: an AngularJS Web project
and an Ionic Mobile project
. And the third repo with an AngularJS module
that will be imported as a git submodule. This third module could be as a Core module with all functionalities (services, directives, filters and so on) that will be shared between the two applications.
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