Example ~/.gitconfig is given below. In it, I define a simple alias that will print a nice log graph, "logtree". "logtree" is invoked from the commandline as "git logtree". Arguments are passed, so I can do "git logtree --oneline" and get the expected result.
[user]
name = "Stephen Rosen"
email = "[email protected]"
[alias]
logtree = "log --graph --decorate --all"
[push]
default = simpleNote that you can invoke non-git commands in an alias, although the syntax is somewhat odd.
[user]
name = "Stephen Rosen"
email = "[email protected]"
[alias]
logtree = "log --graph --decorate --all"
hello = "!bash echo 'hello'"
[push]
default = simpleInvoking multiple commands is difficult, and does not always behave consistently across platforms. I more strongly recommend using bash scripts invoked with "!bash path/to/myscript.sh"
So consider a script, pushall.sh
#!/bin/bash
git push origin
git push upstream
git push devserverput it in ~/.gitscripts/ or a similarly named directory. You can then add an alias
[alias]
pushall = "!bash ~/.gitscripts/pushall.sh"and invoke it with git pushall in any git repository.