Git track remote branch using netbeans

I use Netbeans, and there is a call to the Push to Upstream function. When I click on it, I get the following message:

The tracked remote branch is not specified for the local master

Is there a way to track the remote branch in netbeans or in the configuration file?

Here is my configuration file:

 [core] repositoryformatversion = 0 filemode = false logallrefupdates = true bare = false [remote "master"] url = https://github.com/TheColorRed/JGame.git fetch = +refs/heads/master:refs/remotes/master/master 

I don’t have git on my computer, but Netbeans comes with a git package for performing git operations. I really don't want to load git just to run one line, so is there a way in netbeans or in the configuration file to track the branch?

+6
source share
4 answers

I do not have git installed on my computer

However, this remains the safest solution: just unzip the msysgit archive (you are on the windows) and run:

 git branch -u master origin/master 

Even other users have come to the same conclusion .

+3
source

Maybe my solution for this problem seems too simple, but I had the same error, and instead of using Push to Upstream, you just need to use Push for your first commit. After that, you can select the remote repository / branch in Netbeans.

+3
source

This problem can now be fully resolved in the NetBeans interface. First, right-click on the project and select Git > Branch/Tag > Switch to Branch...

Then select the branch you want (for example, " origin/master ") and select Checkout as New Branch .

This will create a local copy of this branch, so assuming you checked the main branch, you will now see master in addition to origin/master .

0
source

Or you can simply go to Team > Repository > Repository Browser ; in the window that opens, find the local branch, right-click on it and select Setup Tracked Branch

0
source

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


All Articles