'Git GUI push to specific branch

How can i push to specific branch in remote with GIT gui. I can't seem to find an option for it. Let say i want to push to a specific branch name 'branchOne'. How could it be done? I am pushing to gitlab.

enter image description here



Solution 1:[1]

Whenever you push something to a remote server you are pushing a specific branch. In your case you have a master branch so changes in your master branch will be added to remote.

In case you have two branches master and development then while pushing you will have to specify which branch you want to push in GIT GUI, so code committed in that branch will only be added to remote repository.

So technically what you are asking for is not required.

Solution 2:[2]

In git you need to specify the name of the branch to pull or to push.
In older versions it was not mandatory but it had some side effects.

If you wish to push to master you should specify the branch name in your case the tool let you select the desired branch.


SourceTree

The best GUI tool out there today is SourceTree, its much better than the git tool you are using.


Git v2.0 Release Notes

Backward compatibility notes

When git push [$there] does not say what to push, we have used the traditional matching semantics so far (all your branches were sent to the remote as long as there already are branches of the same name over there). In Git 2.0, the default is now the simple semantics, which pushes:

  • only the current branch to the branch with the same name, and only when the current branch is set to integrate with that remote branch, if you are pushing to the same remote as you fetch from; or

  • only the current branch to the branch with the same name, if you are pushing to a remote that is not where you usually fetch from.

You can use the configuration variable push.default to change this. If you are an old-timer who wants to keep using the matching semantics, you can set the variable to "matching", for example. Read the documentation for other possibilities.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 vivek verma
Solution 2 CodeWizard