DEV Community

Discussion on: My Personal Git Tricks Cheatsheet

 
antjanus profile image
Antonin J. (they/them)

I get why it works like that and I'm ok with it :) It really just surprised me but then again, I don't do a lot of bash scripting.

Thread Thread
 
darlanalves profile image
Darlan Alves

The key to it is just escape the $ char in an alias.

alias git-up="git push -u origin \$(git-branch)"

Thread Thread
 
ivanalejandro0 profile image
Ivan Alejandro

Oh, cool. I didn't know about that, thanks.
I've edited my comment escaping the $.