37

I have IntelliJ 14 with GIT integrated. git push command shows the Author as unknown. How do I set the following two parameters in my IntelliJ IDE?

git config --global user.name "Sam Smith"
git config --global user.email [email protected]
1
  • 2
    Can you open a terminal and type git config user.name? Jun 6, 2015 at 1:02

6 Answers 6

28

You can set the username and email for Intellij 14 with GIT integration as follows. This worked for me.

Go to your project where git is initialized.

Then enable the hidden folders and find ".git" and go inside the folder.

Find the file called "config" and add below code and save.

[user]
      name = username
      email = [email protected]
23
  1. Ctrl + K to open commit dialog
  2. Type following pattern into "Git / Author:" dropdown field, replacing parts with personal data(keep space and angle brackets characters):
Name Surname <Email>
3
  • 2
    It's not saving it, do I have to do this everytime?
    – Dave
    Mar 9, 2017 at 15:34
  • 1
    It actually saving it, you just need to type the first couple of letters of your name and then pick from the list. This way you can quickly select the name of anyone ever committed to the project as this list gets aggregated. I like this approach better than a git config because it allows multiple developers to work on one PC that is handy for pair programming for example. Apr 10, 2017 at 21:57
  • In IntelliJ 2020.2, this only performs a commit by a representative author "on behalf of" the project configured author. To reconfigure the official commit author see this answer: stackoverflow.com/a/45327500/2336934
    – dan
    Jan 8, 2021 at 16:31
11

When you are in the commit dialog, just using Ctrl+Space to open the user list and choose one.

enter image description here

11

Assuming that you have installed git from git-scm.com.

For Linux or Mac OS use terminal.

For Windows environment: Use git bash (comes together with git installation) or use Powershell.

Run:

git config --global user.name "Sam Smith"
git config --global user.email [email protected]

Tricky part is: You have to commit at least one time from terminal.

git add my_awesome_file
git commit -m "My commit message"

VIOLA! Now your author is shown in IntelliJ commit panel.

(Note: If you work with different repositories using different emails don't use global configuration)

3

If I were you, I would just copy and paste those two lines in your command prompt; that will set the appropriate values, including for the IDE.

If you really want to set it via the IDE for some reason, I would follow the instructions here.

2

Below is worked for me

root:~/git_workspace/dummyproject$ git config --global user.name "Krunal.Chauhan" root:~/git_workspace/dummyproject$ git config --global user.email [email protected]

set username and email, then I have committed code and pushed it to git. so changes have been reflected. enter image description here

And verified on git enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.