Answer the question
In order to leave comments, you need to log in
Is it possible to make an alias for git push origin?
Is it possible to make an alias for git push origin my_branch so that it works with different branches? Tired of each time you need to enter the name of the branch to write the full command.
Answer the question
In order to leave comments, you need to log in
try these aliases:
# cat ~/.gitconfig
branch-name = "!git rev-parse --abbrev-ref HEAD"
publish = "!git push -u origin $(git branch-name)"
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question