Do all the things like ++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatarSign Up
IntrusionCM402625dThat's a pretty dumb idea...
Not only is it a misusage of git hooks which might lead to all kind of problems - but you push every branch to origin.
Please. Stop doing wrong things to fix an even more wrong workflow.
You'll just stack frustration on more frustration.
@IntrusionCM its completely optional. we are manually setting up for the repos we want. i just wanted to portray an idea about executing a command automatically after running a commit.
I can definitely see myself copying this single file for all my personal projects but not really for work projects (atleast a git push origin master , if not for all branches ^_^!)
and btw what more are the use case of hooks?
That method is fine, so long as you set up two repos:
- The origin repo, source of truth
- Another completely unrelated repo to house your CYA commits
I also prefer just letting that run nightly.
In a nutshell - what you did. ;)
Hooks are just scripts that are ran at a certain point.
Commit message validation, GIT change validation, automated check for linting errors and so on.
The fun part is: It's a non validated process workflow.
Yes. You could do an endless recursion in hooks.
That's the dark side. Git push should be safe - but in a nutshell you're calling in a process that changes your GIT directory another command that might change your GIT directory... Sounds like bad stuff
vintprox149424dGood, now your Git is suddenly Subversion 😜
Root6901524dYo what the fuck, bad.
Maybe with a second repo for only your commits, but you’re going to run into sync issues there.