1

i just not able to add file on github using git bash

error message :

fatal: unable to auto-detect email address (got 'M S@folder.(none)')

i tried this command:

git commit -m "first commit" filename

any help ?

Mohd Murad
  • 27
  • 1
  • 8
  • Run `git config --global --list` . What does it return for `user.name` and `user.email`? – Asif Kamran Malick Apr 03 '21 at 19:21
  • 1
    Does this answer your question? [git: fatal unable to auto-detect email address](https://stackoverflow.com/questions/25671785/git-fatal-unable-to-auto-detect-email-address) – Mike Slinn Apr 03 '21 at 19:22
  • error: src refspec master does not match any error: failed to push some refs to 'https://github.com/muradmohd01/TestGit.git' this message showing what to do?? – Mohd Murad Apr 03 '21 at 19:25
  • looks like default branch is set to `main` or any other name and not `master`. Please verify if this is the case with you. message suggests refspec has no idea about master. please run `git show-ref` to see if it returns main or master – Asif Kamran Malick Apr 03 '21 at 19:36

1 Answers1

1

When you installed git in your system first time, you have to set your user name and email. You can set your credentials using the below given command.

$ git config --global user.email "email_id"

$ git config --global user.name "user_name"

Akinnawo
  • 11
  • 1