As per this question, git-config doesn’t support expansion of variables. What you can do, however, is define an alias with the common parts:
lg = log --graph --pretty=format:'%C(cyan)%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(red)<%an>%Creset' --abbrev-commit --date=relative
Then define further aliases as shell commands that use the common alias:
unreleased = !git --no-pager lg release..master
Incidentally, specifying --date=relative
has no effect, since %cr
in your log format is by definition a relative date. This also means that --date=short
, for example, would have no effect. You’ll need to use %cd
instead if you want any of your other aliases to be able to change the date format.