Matías Fidemraizer Matías Fidemraizer - 6 months ago 36
Git Question

I push a local branch to remote, and the resulting name is "master" while it should be v1

It's as simple as I'm trying to push to remote a branch called

but when I run the command
git push origin v1
, GIT client says:

[new-branch] v1 -> master

...and it should be
v1 -> v1

What am I doing wrong?


git push origin v1:refs/heads/v1 will create the remote branch for you. The left side of the colon is the local branch, the right side is the remote branch. If the right side doesn't exist, it will be created. After that, you may want to use git branch -u as suggested by Tim to set the upstream tracking info correctly.