I want to make a alias, like this below
gc this is a test message
convert to git commit -m "this is a test message"
.
How can I do this? I want that in my bashrc.
I have these alias in my .bashrc:
alias ga='git add'
alias gp='git push'
alias gl='git log'
alias gs='git status'
alias gd='git diff'
alias gdc='git diff --cached'
alias gm='git commit -m'
alias gma='git commit -am'
alias gb='git branch'
alias gc='git checkout'
alias gra='git remote add'
alias grr='git remote rm'
alias gpu='git pull'
alias gcl='git clone'
I normally commit with gm "msg"
bash alias
definitions don't take parameters.
Try using a bash function in your .bashrc:
function gc () {
git commit -m "$*"
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With