-1

It sounds like a similar question to pull/push from multiple remote locations, but it is not.

I have a project, call it iggy-project - and it has a remote repo called iggy-project in github.

Inside iggy-project, I have a dist/ folder that I want to push to a different repo, call it iggy-dist

|-index.html
|-style.css
|-script.js
|-dist/
   |- index.html 
   |- style.css

How can I keep iggy-project pointing to iggy-project remote repo, but push everything inside dist/ into iggy-dist?

Bonus: Is it possible to do this (pushing iggy-dist to iggy-dist remote) every time I push to iggy-project so everything is done under one command?

Iggy
  • 5,129
  • 12
  • 53
  • 87
  • This really feels like an [XY Problem](http://xyproblem.info/) question. If you could share your goals I feel like a much better answer could be provided. – John Pavek Sep 13 '19 at 21:21

1 Answers1

1

You can't really do this easily. You could use Git Submodules or Git Subtree. However, from experience, submodules are just a pain. They look nice at first, but they're cumbersome.

Consider your goals - why do you want to have dist be in another repository? Is there another way you can accomplish your goal without having two repositories?

Drew Blessing
  • 2,595
  • 11
  • 16
  • this could be a good alternative to submodules: https://github.com/ingydotnet/git-subrepo – Serge Sep 13 '19 at 21:30