0

How can I automatically push to subtree when I push to master? My current workflow is to execute this command after push to master:

git subtree push --prefix dist origin branch

Thanks for your help!

RMPR
  • 3,368
  • 4
  • 19
  • 31
  • Possible duplicate [git-is-there-a-way-to-auto-push-a-subtree](https://stackoverflow.com/questions/46714487/git-is-there-a-way-to-auto-push-a-subtree) – RMPR Apr 13 '20 at 10:44
  • 1
    Does this answer your question? [Git: is there a way to auto push a subtree?](https://stackoverflow.com/questions/46714487/git-is-there-a-way-to-auto-push-a-subtree) – RMPR Apr 13 '20 at 10:45

1 Answers1

0

You should be able to make that happen with a Git Hook. Probably post-receive

Git Hooks: https://git-scm.com/docs/githooks#post-receive

It looks like the script here is pretty close to what you need. Git: is there a way to auto push a subtree?

Joe W
  • 2,773
  • 15
  • 35