Skip to main content

Fix the gp alias stamping the wrong date

alias gp="git add . && git commit -m \"Commit: $(date)\" && git push"

Because the alias is defined with double quotes, $(date) is evaluated once when the shell starts, not when the alias runs. Every commit made with gp is stamped with the time you last opened that terminal.

So a day's worth of gp commits all claim the same time, and it's the wrong one.

Fix

Single quotes, so the substitution happens at run time:

alias gp='git add . && git commit -m "Commit: $(date)" && git push'

Worth noting the commit message is fairly useless either way. gpx already exists as the deliberate junk-commit escape hatch, so gp could reasonably prompt for a real message instead.