I checked out a branch let's call 1.14
from the remote 1.14
branch. I made local changes and made a commit, changed my local branch to something else, let's call mynew
. If I run git branch -vv
I see that
mynew efe918d [origin/1.14: ahead 1] commit_msg
Now I want to push this mynew
not into the origin/1.14
but a new let's call origin/mynew
, which isn't exist yet, I want to create it by pushing the local one.
How could I do this?
You can specify the destination branch on push
command
git push origin localBranch:remoteBranch
In your case you can write
git push origin mynew:mynew
If mynew
doesn't exist on the server, it will create it.
To set up mynew
local branch to be linked (when pulling, pushing) to remote mynew
branch use -u
or --set-upstream
equivalent option
git push -u origin mynew:mynew
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With