I'm building a web-application that has 2 separate components: The front-end that runs in the user's browser (Javascript + Angular) and a back-end REST Api (Python/Django) that runs on my server and feeds data to all the front-ends. The two parts of this app are placed into two separate Git repositories and stored in BitBucket.
The front-end displays the data to the user win a beautiful interface that has lots of nice CSS defined. The back-end sends emails to the users.
I would like the look-and-feel of the emails to exactly match the front-end's display. All the user's interaction should have a uniform presentation. So where/how should I put the CSS such that it is available in both repositories, but I only have to make changes to it in one place??
How do I do this with the tools I'm using: Git & Bitbucket?
I think the CSS should be in a separate "third" project altogether.
Especially since you may even want to reuse the nice CSS for another project, or break the existing projects into more repositories.
So the strategy is:
git subtree
or git submodule
.For example, if you prefer git subtree
to have the third project's files part of each of the two existing projects, you can follow a blog/tutorial like this one:
https://developer.atlassian.com/blog/2015/05/the-power-of-git-subtree/
Whether you use git subtree
or git submodule
, that depends on the trade-offs you're ok with.
write a script in the git pre-commit hook, if the css file is changed, then the script could push the change to BitBucket. See
git help githooks
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