74

I'm new to SmartGit. I can't commit through my repository, the message I'm receiving is:

Unable to auto-detect email address (got 'Arreane@Arreane-PC.(none)')

*** Please tell me who you are.

Run
  git config --global user.email "you@example.com"
  git config --global user.name "Your Name"


to set your account's default identity.

Omit --global to set the identity only in this repository

I'm using a different PC, but if I commit at home it commits and pushes perfectly, I don't know if this was the cause of the problem.

I've searched around and others say to edit the .git/config file, but I cannot find this file.

What am I missing?

stkent
  • 18,470
  • 14
  • 80
  • 99

14 Answers14

95

Well, the message is pretty much self-explanatory. You did not tell git what your name and email address is.

Open a command line and type:

git config --global user.email "you@example.com"
git config --global user.name "Your Name"

Of course you should enter your real name and email. Afterwards git knows who you are and is able to insert this information in your commits.

Seems like smartgit does not add the git binary to your path. You have to add its path to the PATH environment variable or first change to the corresponding directory. You can find a screencast here: http://blog.dragndream.com/?p=97

michas
  • 22,506
  • 9
  • 64
  • 105
  • 2
    thank you for the reply, it says `git` is not recognized as as internal or external command however, I managed to find a solution I edited my .config file in c:/users/my_name/.gitconfig and added [user] name = my name email = myemail@email.com – Arreane Diez Coyoca May 08 '13 at 07:21
  • 1
    It sounds like you need to find where the smartgit menu option is to set your username, and that smartgit is hiding git itself, leaving you in the difficult situation you listed. – Philip Oakley May 08 '13 at 11:18
  • Seems like git is not in your path. You have to change to the right directory first: http://blog.dragndream.com/?p=97 – michas May 08 '13 at 14:05
  • @ArreaneDiezCoyoca use Git Bash app. It resembles like a CMD in Windows but features all GIT command lines. Install first GIT and then right-click on the master repo and choose Git Bash. Try entering it. – David Dimalanta Nov 07 '14 at 04:26
23

If you are using sourcetree: Repository -> Repository Settings --> Advanced --> uncheck "Use global user settings" box

worked great for me.

DoronK
  • 4,469
  • 2
  • 30
  • 35
20

You can solve the problem with the global solution, but firstly I want to describe the solution for each project individually, cause of trustfully compatibility with most of Git clients and other implemented Git environments:

  • Individual Solution

Go to the following location:

Local/repo/location/.git/

open "config" file there, and set your parameters like the example (add to the end of the file):

[user]
    name = YOUR-NAME
    email = YOUR-EMAIL-ADDRESS
  • Global Solution

Open a command line and type:

git config --global user.email "YOU@EXAMPLE.COM"
git config --global user.name "YOUR NAME"
Shayan Amani
  • 4,216
  • 1
  • 31
  • 35
12

Just type like "correct" case

"wrong"

git config --global mike.email "mike@gmail.com"
git config --global mike.name  "mike"

"correct"

git config --global user.email "mike@gmail.com"    
git config --global user.name "mike"

user.name is your account name in git-hub user.email is your email when you sign in git-hub.

Jun Young Ahn
  • 121
  • 1
  • 3
5

Try the following steps,

  1. Open command prompt and then run
  2. git config --global user.email "YOU@EXAMPLE.COM" // put your email address press enter
  3. git config --global user.name "YOUR NAME" // put your name
Codemaker
  • 4,115
  • 1
  • 32
  • 30
Suraj Verma
  • 365
  • 3
  • 8
  • Welcome to [so]. Please read the other answers before posting your own. This answer has already been given many times, e.g. [this one](https://stackoverflow.com/a/16434080/). Parotting other answers without adding anything of value does not help anybody. – Adrian W Jan 12 '19 at 07:26
3

it's pretty simple but tricky at the first time.
For example:
If my email is mrsuicidesheep@gmail.com type:

git config --global user.email mrsuicidesheep@gmail.com

OR

If my username is mrsuicidesheep type:

git config user.name mrsuicidesheep
tso
  • 4,174
  • 2
  • 17
  • 30
2

This problem has very simple solution. Just open your SmartGit, then go to Repository option(On top left), then go to settings. It will open a dialog box of Repository Settings. Now, click on Commit TAB and write your UserName and EmailId which you give on BitBucke website. Now click ok and again try to Commit and it works fine now.

Santosh
  • 56
  • 6
1

With SmartGit, you can also edit them by going to Project > Repository settings and hitting the "Commit" tab (make sure to have "Remember as default" selected).

mstrap
  • 15,236
  • 6
  • 50
  • 77
1

In case you're using git, use the right email address you used for github registration and then your computer name. this worked for me.

alan
  • 21
  • 5
1

Put your computer's username

git config --global user.email "YOU@EXAMPLE.COM"
git config --global user.name "YOUR COMPUTER\'S USERNAME"
eskatos
  • 3,495
  • 2
  • 33
  • 37
0

open your git command line

put

git config --global user.email "you@example.com"

this command on command line and change email address put your own email which those use creating accout for github

hit enter

put git config --global user.name "Your Name"

use your own name insted of your name

hit enter

its work...

0

Ran the sample of these commands:

git config --global user.email "focus1@gmail.com"

git config --global user.name "focus1"

Footnote:

focus1@gmail.com === email address used to login to your github account.

focus === your github username

-1
git config --global user.email "put your email address here" # user.email will still be there  
git config --global user.name "put your github username here" # user.name will still be there

Note: it might prompt you to enter your git username and password. This works fine for me.

Patrick
  • 1,615
  • 6
  • 18
  • 27
-4

Make sure that you opened git as admin or root.

  • This is an interesting problem. If you work on the workspace with only root privileges, than you need git configurations for root user. Otherwise it isn't needed. – Silerra Feb 02 '19 at 19:01
  • The better way would be for you work on local workspace without root privileges and if you need the changes on public space than you can push from local workspace to public webspace with write permissions for root and read permissions for viewers. – Silerra Feb 02 '19 at 19:15