'Can I use a submodule to push common code to several branches in the containing repo?

I have a repo that contains several branches, and always will. I want to be able to push common code to all of the branches simultaneously. Is it feasible to use a submodule in my repo?

Thank you.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source