How can I push to a non-bare git repository, automatically add and commit any changes in the working tree, and then re-checkout the current branch to reflect the changes from that push?
I was thinking of something like this:
Add a hook on the remote (the non-bare repo) to run git add . && git commit -m "Automated commit" && git reset --hard
Are there any drawbacks to that method? Is there another way of doing this?
(Disclaimer: I know that this isn't the most ideal situation, but this is what we have at my company and I want to make it as streamlined as possible without needing everyone to completely change the way they do things)
Thanks!