Git offers nice option to track changes in multiple remote branhces. But is there a way to set this feature by default? What I mean is that when someone clones a repository, it's is by default already tracking two remotes.
The scenario is like this
- We have a some shared code in remote repo called libs
- We have another project that has forked this repo in order to enhance it, called enhancedLibs
- When someone makes a commit to libs, a manual sync is done to add the changes to enhancedLibs as well.
- Changes from libs are taken to enhancedLibs, but not the other way around (or it is very rare)
There are some obvious problems with this
- The sync is forgotten to do (with a dynamic language there errors are spotted quite late)
- Git does not directly show in the commit history that where the change came from. It's up to the developer to add details.
Tracking multiple branches seems to fit the bill per my understanding, but the setup is the question here. we are using Atlassian Stash, but I'd prefer a Git only solution if available.
Also keen to know of alternative solutions. For example, would some mirror setup help here?