Reputation: 1611
Is there a way to refer to the current branch during git push origin instead of using full name like:
git push origin myBranch
I was thinking of linux "." like operator to refer to current branch without having to use its full name.
Upvotes: 1
Views: 175
Reputation: 43234
Do this:
git branch --set-upstream-to origin/myBranch
Then you can just do
git push
From the man page:
--set-upstream-to=<upstream> Set up <branchname>'s tracking information so <upstream> is considered <branchname>'s upstream branch. If no <branchname> is specified, then it defaults to the current branch.
See this other answer for details
Upvotes: 2