- git push -u origin branchname.
- git push -u origin HEAD.
- [alias] mr = push -u origin HEAD.
Likewise, people ask, how do I push changes to a current branch?
The simplest way: run git push -u origin feature/123-sandbox-tests once. That pushes the branch the way you're used to doing it and also sets the upstream tracking info in your local config. After that, you can just git push to push tracked branches to their upstream remote(s).
Additionally, how do I know my current branch? There are several ways to get the name of the current branch in Git:
- git-branch. The --show-current option of git-branch command can be used to print the name of the current branch.
- git-rev-parse. Another plausible way of retrieving the name of the current branch is with git-rev-parse .
- git-symbolic-ref.
- git-name-rev.
Moreover, how do I push all branches?
If you use git branches a lot, you'll often push each branch after each commit. Instead of pushing every single branch you can do git push --all origin . This will push all commits of all branches to origin.
Does git push only push current branch?
Regardless which option you use you can manually do a git push origin my-branch to explicitly push only your current branch.
