Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git track a remote branch using netbeans

Tags:

git

netbeans

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?

like image 418
Get Off My Lawn Avatar asked Aug 10 '13 01:08

Get Off My Lawn


People also ask

How do I start tracking a remote branch?

When you're publishing a local branch. You can tell Git to track the newly created remote branch simply by using the -u flag with "git push".


2 Answers

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.

like image 77
Manuel Avatar answered Sep 23 '22 21:09

Manuel


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.

like image 43
VonC Avatar answered Sep 22 '22 21:09

VonC