+ 4
Is it possible to combine two git commands into one by assigning it an alias?
6 Respuestas
+ 4
Yes you can use && to separate the commands and they should work.
This one is an alias set in oh my bash
gac='git add -A && git commit -m "init"'
+ 6
Ankit is there an advantage to using && over ; (semi colon) ?
+ 5
Jared Bird thanks.
+ 3
Ankit thank you
+ 3
Sonic with ; it will run one command then the other.
With && it will run one command then only if no error run the next command.
+ 1
Sonic I've always used && so i don't exactly know but they are quite similar.