DEV Community

Daniele Scasciafratte
Daniele Scasciafratte

Posted on • Originally published at daniele.tech

Upload stuff on git push when branch is not master

The first rule of optimization is: When something require many steps and can be automatized, do a script.

At least in my mind this my first rule and I do a script when I do the same things to many times.

Let's see Git hooks with a real user case with code!

The post Upload stuff on git push when branch is not master appeared first on Daniele Mte90 Scasciafratte.

Oldest comments (2)

Collapse
 
vlasales profile image
Vlastimil Pospichal
current_branch="$(git symbolic-ref --short HEAD)"
Collapse
 
mte90 profile image
Daniele Scasciafratte

Yes this is a way, my idea was to show also an user case about why you need to know that and use also the hooks :-)