Git in Netbeans — Push or Push to Upstream

Netbeans' Git client is a bit different that others (like TortoiseSVN) and offers additional option for push/pull commands (starting from version 7.3). It is Push to Upstream and Pull from Upstream. What is the difference from regular "non-upstream" versions. Not to big. Second ("upstream") ones offer dirrect execution of command, without displaying any dialog (if properly configured). While regular ("non-upstream") always opens Push to Remote Repository dialog.

So, after initial configuration, it is more convinient to use Push to Upstream instead of Push.

It is always a few clicks less, right? :]

Since, Netbeans doesn't allow adding push/pull related commands to toolbar, it is usefull to set own keyboard shortcut for Push to Upstream command and be able to push changes to remote repository withing few keyboard buttons press.

Note, if after using Push to Upstream or Pull from Upstream command, you see error saying: "No tracked remote branch specified for local master", then you should run command-line (in Windows: cmd), navigate to your project / local git repo root folder and execute following command:

git branch --set-upstream local-branch-name origin/remote-branch-name

If you are farily new to Git or you're a former SVN user and you don't play with all this branch-like stuff at all (using only master branch all the time), you can use just:

git branch --set-upstream master origin/master

After this, Netbeans shouldn't comply any more and should let you execute Push to Upstream or Pull from Upstream commands without any problems.

Leave a Reply