I want to restart my virtual server after switching branches, and tried adding some aliases in my .gitconfig but did not get it to work.
co = checkout | !rap
only runs rap, the restart script.
co = checkout && !rap
and some other things I tried (like checkout $1) gives my “git usage: bla bla”.
I think, what you really want is
post-checkouthook (look into your.git/hooks/directory and githooks manpage).