DEV Community

Discussion on: Automating git push with just a single bash command

Collapse
 
thorstenhirsch profile image
Info Comment hidden by post author - thread only visible in this permalink
Thorsten Hirsch

There are probably not many developers out there who favour the CLI over a Git UI, but at the same time are too lazy to type 3 short commands + commit message instead of 1 short command + commit message.

However my workflow doesn't even include git add . every time I want to commit something. It could add temporary/build files that I don't want being tracked by git, so git -a -m '...' is a safer approach, by which we're down to 2 short commands + commit message (w/o your script).

Oh, and please don't start start a "TLDR" with "Basically this is a self explanatory code", because TLDR makes the reader expect a summary. And telling your reader to read the complete code is the opposite of a summary. Btw: it has to be if [ -n $(...) ] instead of if [ n $(...) ].

Some comments have been hidden by the post's author - find out more