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