Home > Software engineering >  Can I push other branch to remote as current?
Can I push other branch to remote as current?

Time:11-30

I've prematurely deleted remote branch, before merging to all productive branches.

I've got the branch locally, but I couldn't find out, how to push it WITHOUT checkouting it.

I know I can git push <remote> <branch> to push current branch under another remote name.

But how to push branch other than current to the remote?

CodePudding user response:

You can name the local branch by separating it from the remote name with a :. eg:

git push $remote $local_branch:$remote_branch

CodePudding user response:

To push a specific branch, run git push <remote> <branch>.

  •  Tags:  
  • git
  • Related