So I trying to push changes from my local branch to the remote branch with the same name. And im trying to do something like this.
git push origin "git rev-parse --abbrev-ref HEAD"
The command inside the quotes return the name of the current checked out branch. I'm not sure if this is possible.
Essentially, i'm building an alias that would add, commit and push for me, and it would look something like this:
git config --global alias.fire '!f() {
git add -A && git commit -m "$1" && git push origin "git rev-parse --abbrev-ref HEAD";
}; f'
right now, im just stuck at trying to get the name of the currently checked out branch and use it in another command. Anyone got any suggestion or different approach? Thanks
EDIT: I'm using windows