I have one branch master on the server (remote). I created new local branch that doesn't exist on the remote (server). How can I add (push) the branch to the remote (server) without merging it with the master branch
You can use the following command:
git push -u origin newBranch
-u
will set up your local branch to track the remote branch.
git push remote local_branch_name:remote_branch_name
Usually your remote will be origin, and both local and remote branch will be the same (although you can push local branch as a remote with different name). If their names are identical you don't have to provide colon-separated names -- one will be sufficient.
What you are trying to achieve has nothing to do with merging branches. I'd suggest further reading about branches and remotes (git-scm book is pretty good resource).
You just push your local branch:
$ git push origin <your-branch>
You can use the -u
flag to set your local brach to track the remote too.
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