Search code examples
gitchangelog

Single changelog from multiple Git repos


I don't know if this has already been answered, but I couldn't find an answer for my problem. Example scenario is something like this:

Developer 1 works on project A

Developer 2 works on project B

Both developers work on project C (where shared libraries reside)

Developer 1 wants to generate a log from commits of project A and project C (commits made by him)

I have seen custom scripts making this but I want to know if there's a way to do this using Git (windows) only.


Solution

  • Git itself has no convenient way to do what you want. There is definitely a set of functions which, if used correctly, can do what you want. Fortunately few git extensions already implement the functionality.

    Git subtree is a part of git distribution package and allows to map another project repo into your main project repo. It allows mapping histories between the main and project and the sub-projects. It seems to be a good candidate to solving your issues.

    It is implemented as a very simple script and has some disadvantages. For example, the mapping information is not passed through the clones. This had been solved with 'git-subrepo' script. So, this could be a second candidate for you.

    Git submodules do not provide history mapping and most likely would be difficult to use in your case.