Push To A Branch On Another Remote
The kind of git-push I do most often is:
$ git push origin HEADwhich I have aliased to put in my .gitconfig.
HEAD generally refers to whatever branch you currently have checked out. So this command will take the state of your current branch and push it to the branch of the same name on the origin, which is a remote (see git remote -v).
If you have other remotes set up, such as a staging, heroku, etc., then you may instead want to push to one of those.
$ git push heroku HEADThis will push the state of the current branch to that branch on the heroku remote.
If I instead want to push the changes from one local branch to a different named remote branch, then I have to specify both like so:
$ git push heroku staging:mainThis will push the state of my local staging branch to the main branch on the heroku remote.
Last updated
Was this helpful?