Hacker News new | ask | show | jobs
by hokkos 3752 days ago
Your monolith project seems very interesting to me, because I have 3 repos for components of a common project that leaded to duplicated code. But I also regret to have added some assets code that lead to a massive and slow repo, so it seems it is also possible to filter the history from some directories but I am not quite sure from your description.
1 comments

Nice, we had a similar issue which is why we decided to merge the repositories. It makes sharing code, extracting shared dependencies, and reviewing PRs so much easier when you can see changes across all projects in one diff!

You can absolutely filter the history from some directories by specifying a script to run after the repositories have been cloned. In your monolith.yml you can add something like:

  # Optional list of commands to run right after
  # all of the repositories above have been cloned.
  #
  # These are handy for things like rewriting history
  # to remove large unused files or sensitive information.
  after_clone:
    - ./remove_large_assets
Then define the `remove_large_assets` script in whatever language you want and have it run the appropriate git commands to filter that history!

After the files are filtered, the monolith repository will be generated without all that junk that was bloating your git history.