I want to create a Git alias to perform multiple commands, but I cant find documentation on how this is done.
Say the commands are echo a
and echo b
(not a
and b
), to add multiple commands for an alias q
:
From the command line:
git config alias.q '!echo a; echo b'
Directly in the configuration file:
[alias]
q = "!echo a; echo b"
For more complex things, define a shell function and call it:
'!f() { echo a ; echo b ; }; f'
For passing parameters to the commands see:
Git alias with positional parameters
Git Alias - Multiple Commands and Parameters
Based in Jonathan Wakely's comment