Reputation: 36331
I am using Netbeans, and there is a feature call Push to Upstream
. When I click it I get this message:
No tracked remote branch specified for local master
Is there a way to track the remote branch in netbeans, or in the config file?
Here is my config 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
installed on my computer, but Netbeans comes with a git package to do git operations. I don't really want to download git just to run one line, so is there a way in netbeans or in the config file to track a branch?
Upvotes: 9
Views: 7062
Reputation: 8572
We keep encountering this problem and it's enough to make you mad. I've had to re-clone the repo several dozzen times by now.
Thanks to @Damian for their solution. I was a little lost in their answer, so after figuring it out thought I'd share how we were able to solve this:
Team
> Repository
> Repository Browser
Branches
> Local
Set Tracked Branch
Upvotes: 4
Reputation: 2949
Your local branch doesn't track remote branch. You can bind them in command line
git branch --set-upstream-to origin/master master
Or in GUI:
Git Repository Browser
Braches
-> Local
-> master
(or whatever branch you want)Setup Tracked Branch
Upvotes: 0
Reputation: 41
Or you could just go to Team > Repository > Repository Browser
; in the window that opens find your local branch, right-click it and select Setup Tracked Branch
Upvotes: 0
Reputation: 7319
This issue can now be solved entirely within the NetBeans interface. First, right click on the project and select Git > Branch/Tag > Switch to Branch...
Then select the desired branch (e.g. "origin/master
"), and select Checkout as New Branch
.
This will create a local copy of that branch, so assuming you checked out the master branch, you will now see master
in addition to origin/master
.
Upvotes: 0
Reputation: 443
Maybe my solution for this problem seems to be too easy, but I had the same error and instead of using Push to Upstream you just have to use Push for your first commit. Afterwards you can select your remote repository/branch in Netbeans.
Upvotes: 5
Reputation: 1326006
I don't have git installed on my computer
Yet, that remains the safest solution: simply unzip the archive msysgit (it you are on windows), and do a:
git branch -u master origin/master
Even other users came to the same conclusion.
Upvotes: 3