a nasty git bash alias hack
DO NOT DO THIS IN THE REAL WORLD
create a file ~/.bash_aliases
$ cat ~/.bash_aliases
alias ga="git add ."
alias gc='git commit -m "autocommit"'
alias gd="git diff"
alias gp="git push"
alias gs="git status"
now you can add commit and push with 6 chars
$ ga
$ gc
$ gp
WARNING
FOR RAPID PROTOTYPING USE ONLY
this is a sackable offence in many outfits as it creates meaningless commit messages π
Top comments (11)
If you replace
with just
You could do
and it would be a timezaver for real projects too
you havent met my mgr have you ? so thanks but "fixed something" would be unacceptable :) it needs to have the JIRA num in it at least
π π Good manager you've got there, Clive. I don't think mine has ever even seen my commit messages, let alone cares about them.
But I think Maurits' point was more that if you don't include a default commit message in the alias, you can save yourself some typing (by shortening
git commit -m
togc
) while still requiring a message from yourself on the command line.I started using Zsh as a default shell instead of Bash a few years ago (no real reason besides curiosity) along with the Oh My Zsh framework, and that framework adds a metric shit-ton of git aliases along those lines.
I don't use them these days as I prefer interacting with
git
directly from my editor, but I tried them out in the beginning and they were fun to use for awhile.yes your right he is NOT actually recommending the same text for every commit if you read carefully sorry my mistake
and i certainly hope your mgr isnt reading DEVTO ! :)
Why do you recommend not to use in the real world? I don't think there is any issues with this...
have a quiet chat with your mgr :)
Sorry for my ignorance, but what is "mgr"? Manager?
sorry mgr is shorthand for manager most dev mgrs require you to at least put the jira number in any git comment :)
Ahh ok, thanks, I assumed so, but was not sure :P
nice one ! i will replace my alias list with that much more comprehensive one !