Git push branch without merging

I have one master server on the server (remote). I created a new local branch that does not exist on the remote server. How can I add (push) a branch to a remote (server) without combining it with the main branch

+4
source share
3 answers
git push remote local_branch_name:remote_branch_name 

Usually your remote will happen, and both the local and remote branches will be the same (although you can click on the local branch as a remote with a different name). If their names are identical, you do not need to provide names separated by colons - that will be enough.

What you are trying to achieve has nothing to do with branching. I would suggest continuing reading about branches and consoles ( git -scm book is a pretty good resource).

+4
source

You can use the following command:

 git push -u origin newBranch 

-u configure the local branch to track the remote branch.

+6
source

You just push your local branch:

 $ git push origin <your-branch> 

You can use the -u flag to set the local shoulder for tracking the remote too.

0
source

Source: https://habr.com/ru/post/1447951/


All Articles