DEV Community

Discussion on: 5 Great Git CLI Shortcuts

Collapse
 
syntaxseed profile image
SyntaxSeed (Sherri W)

One of my fav aliases I always set up in git's own aliasing config is:

git ac

For git "all commit". Which is an alias for git add .; git commit -m.

To just add & commit everything in one go.

Collapse
 
jrgould profile image
Jeff Gould

I like that - I have gc aliased to git commit so I'll usually do gc -am "commit message" but that does have the the drawback of not adding new files and I forget that 90% of the time and then have to amend the commit which is a whole thing.

Collapse
 
jkkgbe profile image
Jakub

git add . is 'all commit' only if you have changes on the current path. If you have changes in e.g. sibling dir it won't work as you'd have to go up the path which is ... For a true 'all commit' use git add -A.

Collapse
 
syntaxseed profile image
SyntaxSeed (Sherri W) • Edited

Thanks!
I do always run this from project root so I'm ok. But I think I'll switch to your suggestion! :)