This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 239587 - Cannot set default git user
Summary: Cannot set default git user
Status: RESOLVED FIXED
Alias: None
Product: versioncontrol
Classification: Unclassified
Component: Git (show other bugs)
Version: 7.4
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: Ondrej Vrabec
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-12-18 06:37 UTC by 1Rogue
Modified: 2013-12-20 12:54 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
user gitconfig (49 bytes, application/octet-stream)
2013-12-19 09:47 UTC, Ondrej Vrabec
Details
generated gitconfig (67 bytes, application/octet-stream)
2013-12-20 12:47 UTC, 1Rogue
Details

Note You need to log in before you can comment on or make changes to this bug.
Description 1Rogue 2013-12-18 06:37:15 UTC
I cannot for the life of me set a default git user/email. When entering one manually into the "commit" prompt when working with a repository, whatever I enter will not be what is set the next time around. It will be available in the drop-down, but not set to default.

I have also attempted setting [user] in a .gitconfig file for the local project, as well as modifying the netbeans preferences in the application data directory, no dice. By default it sets:

windowsuser@myip

On every attempt to commit. This is somewhat frustrating, considering I click through fast enough. A fresh re-installation did not fix this issue.
Comment 1 Ondrej Vrabec 2013-12-18 08:44:56 UTC
Cannot reproduce. This was fixed in #228464, by default the selected user is the one specified in .git/config. If you really can reproduce this in 7.4 then attach the full messages.log after you open the commit dialog and paste here what you specify in .git/config as [user]
Comment 2 1Rogue 2013-12-18 18:56:43 UTC
Sure thing.

I re-tested the local "config" file via the .git folder (which worked there), however I can only set those for one project at a single time. My issue is that it globally sets the user back to "name <user@ip>".

Here's a quick video of it happening in my IDE:
http://www.youtube.com/watch?v=2cRNM0w7v5U

And here is my messages.log from that point:
http://pastebin.com/raw.php?i=DM0ECv0v

Keep in mind I did a couple things outside of the video (testing with another repo), but it should all be there.
Comment 3 Ondrej Vrabec 2013-12-19 09:44:33 UTC
Git has two kinds of config files that affect what is set as the default author/committer.
The first is the local .git/config file which you're already familiar with. This file affects only the repository it is stored in.
The second is the global user-wide config file that affects all your repositories. This is the place where you set your primary name and email. On Linux it is in ~/.gitconfig. On Windows it should be located in $HOME\.gitconfig or anywhere your preferences folder is stored. If not, create it there.

Save the attached .gitconfig file to your $HOME and it will affect all your projects globally.
Comment 4 Ondrej Vrabec 2013-12-19 09:47:38 UTC
Created attachment 143331 [details]
user gitconfig
Comment 5 Ondrej Vrabec 2013-12-19 09:48:43 UTC
save the file, change name and username inside and commit on several projects. Does it solve your problem?
Comment 6 1Rogue 2013-12-20 12:46:38 UTC
See, that is the strange part. Netbeans has created a .gitconfig in my user directory, with the appropriate defaults. However, it does not use these.

I've attached what netbeans generated above. I'll attempt replacing it now with the one provided (changing the defaults, of course)
Comment 7 1Rogue 2013-12-20 12:47:36 UTC
Created attachment 143374 [details]
generated gitconfig
Comment 8 1Rogue 2013-12-20 12:54:14 UTC
Yeah, it seems the provided "user gitconfig" also did not work. What seemed to finally fix it was going into cmd and renaming the file to have a proceeding dot to it (similar to what I've seen with most git configurations). It would seem my installation of netbeans either does not create the file this way or perhaps there's a permissions issue, however I've managed to at least solve it for myself now. Thanks for the support :)