DEV Community

Discussion on: Next step Git for those that already know add and commit

Collapse
 
ghost profile image
Ghost

This is actually the best! Thank you so much!

One question, though: with the aliases, is their anyway to make it so that it accepts terms? i.e. I want to make it so I can do $ git c "commit message", and it'll action that as $ git commit -m "commit message". Is that possible?

Collapse
 
t4rzsan profile image
Jakob Christensen

You are welcome :)

Aliases are really just a search and replace. So you can do

git config --global alias.cm "commit -m" 

and then


git cm "My commit message"

will be replaced with

git commit -m "My commit message"
Collapse
 
ghost profile image
Ghost

Ah, gotcha! Thank you so much again!