5

I have a local git repository. Recently I have added a remote repository from bitbucket, and have pushed my branch there without any problem by: git push bitbucket (since I've configured username and password in https url). But when I try to push, using NetBeans, I always get 401 Unauthorized, when I choose from configured remote repos list and when I try to enter the remote repo details manually. I have the most recent version of NetBeans and Git plugin.

Thanks for any help in advance.

Ojonugwa Jude Ochalifu
  • 26,627
  • 26
  • 120
  • 132
Valentin Stoianoff
  • 187
  • 3
  • 3
  • 11

2 Answers2

4

It is a bug in NetBeans. Seams fixed in NetBeans 7.2, and looks even better in NetBeans 7.3, so perhaps you could try an upgrade. I find it stable and reliable.

Note that you can have more than one version of NetBeans installed just in case you need to switch, and since you use git and push, you should not fear losing data.

Hermes
  • 756
  • 7
  • 10
2

Are you using the right version of Git, as mentioned in this thread?

I had the same problem. Which version of Git are you running? (git --version will tell you.)

Prior to 1.6.6, Git didn't support "smart" HTTP.
Bitbucket doesn't support "dumb" HTTP, so you'll need to upgrade to a newer version of Git.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • git version 1.7.6.1, I don't get any errors while pushing through console. I've looked up the output of netbeans - it doesn't use the remote repository name for some reason, but uses the full url and does not put a password there. – Valentin Stoianoff Nov 04 '11 at 22:40
  • @ValentinStoianoff: then if Netbeans doesn't want to put the password in the Git url it uses, it must rely on a `~/.netrc` file (or `%HOME%\_netrc` on Windows: http://stackoverflow.com/questions/7773181/git-keeps-prompting-me-for-password/7773374#7773374 or http://stackoverflow.com/questions/6031214/git-how-to-use-netrc-file-on-windows-to-save-user-and-password/6031266#6031266) for the username and password. Can you try define that file and its content, to see if Netbeans behaves then? – VonC Nov 04 '11 at 22:45
  • I have put this: machine bitbucket.org login my_login password my_password In ~/.netrc (I'm on a mac) - did not help... – Valentin Stoianoff Nov 04 '11 at 22:49
  • @ValentinStoianoff: did you remove the username and passowrd from the remote url? Does Netbeans consider the same HOME than your shell (I suppose so bit it never hurts to watch). Do you have changed the location of the local Git repo (as in this bug reports: https://bitbucket.org/sdorra/scm-manager/issue/29/http-authentication-doesnt-work-for-push) – VonC Nov 04 '11 at 23:16