2

I am following this http://netbeans.org/kb/docs/ide/git.html tutorial. I went through the first phase and got the git console to print "...finished" as is presented in the picture. Then I want to add/commit my files, but when I click right button to any file I see no GIT menu at all.

On the Team menu there is only initialize and clone under GIT. I am kinda new with GIT (or version controlling at all), so what I am missing here?

Gessle
  • 255
  • 1
  • 3
  • 10
  • Would http://stackoverflow.com/questions/8917286/netbeans-and-git-i-did-install-git-plugin-but-does-not-connect-to-repo-after-in help? – VonC Apr 13 '12 at 11:32
  • Yes and no :) I realized that if I use the default path when I initialize Git repository it works, but if I select another path, it doesn't work. But I can use any path I want, can't I? – Gessle Apr 13 '12 at 18:01
  • "But I can use any path I want, can't I?" Not sure actually. It is possible, provided the Git Netbean plugin pass the "`git-dir`" parameter to all its git commands (http://stackoverflow.com/a/9746005/6309). Did you try setting that git directory just at the same place your sources are? – VonC Apr 13 '12 at 18:22
  • That was the default directory, so yes :) – Gessle Apr 14 '12 at 11:50
  • @VonC your comments should be posted as an accepted answer, so other users can see this question has been answered properly. – Paolo Stefan May 29 '12 at 14:25
  • NB802: When starting NB, Git is an option in the Team menu, but as soon as one starts to do something, e.g. select a loaded project, the git (and many other options) are gone from the Team menu. The Team menu is very context dependent. What is the reason for this behaviour, and how to fix? – carl Feb 24 '16 at 11:12

3 Answers3

1

As the OP comments, it will work when using, for the repository path, the default one (ie the one of the netbean project)

Git init with Netbeans


Update August 2016

Note: For NetBeans 8.1 (release in Oct. 2015), as mentioned by Darek MST, the option is also in Team / Git / Initialize Repository:

Main Menu

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
0

You need to clone or create (initialize) a new repository, otherwise you have nothing to to commit to.

http://help.github.com/create-a-repo/

sjakubowski
  • 2,913
  • 28
  • 36
0

In my case, I had ".svn" subdirectory also, and that was the problem.

Ruben Rivero
  • 303
  • 2
  • 8