bahmutov / pre-git

Automatically install pre-commit / pre-push hooks in your git repo
168 stars 22 forks source link

Running grunt build tasks on pre-push hook #168

Closed leem32 closed 5 years ago

leem32 commented 5 years ago

Reading through the pre-git docs I notice that the Grunt build tasks in the configuration section are run with the Pre-push hook, but I'm having trouble wrapping my head around how that would work.

Whats the workflow here? I can't deploy the built files to the same src location because I don't want to overwrite my dev files. Nor do I want to push my dev files to the remote server. I only want to commit my dev files.

If I move the built files into a seperate deploy folder, I would still be pushing my dev fles to remote server.

The only way I can think of doing this is having a seperate git repo that I use just for pushing the built source files to remote. So, I would use the Pre-commit hook to add the built source files to seperate git repo and then manually cd into that repo and run git push origin from there.

This seems clunky and error prone to me though. It would be very easy to mistakenly push my working directory dev files to the remote instead of the built source files. It also requres an extra step over adding all the built files on pre-push.

Thanks :)

leem32 commented 5 years ago

I figured out an efficient git to grunt workflow myself, but I don't use Pre-git now. So closing this thread.