Linking repo subfolders with git
I have a project on Red Hat OpenShift (git) and a project on Bitbucket (git).
How do I link a subfolder of the Bitbucket project to a subfolder of the OpenShift project?
(so that making commits in one subfolder makes those same commits in the other)
2 Solutions collect form web for “Linking repo subfolders with git”
Git has a feature called submodules that allows you to do this; the cost is some added complexity when updating the project. OpenShift should handle the submodules correctly, but I haven’t personally tried it. If you want to see how OpenShift handles submodules for git repos, please take a look at this script.
Add both repositories as remotes to your local clone, and propagate commits with git fetch/push. If the servers can push to each other, and you have the ability to run hooks on them, you could set up an update-hook on one of the servers so that it automatically pushes to the other. See githooks(5)