4

I am using github desktop to upload some code for a basic website then use github pages. However, every time i try to commit to main, an error comes up saying "Author identity unknown."

I understand I have to put my name and email in the file but where, there's two html files with JavaScript and css but I don't know where i put this information.

the error message

ti7
  • 16,375
  • 6
  • 40
  • 68
Vanya Novikov
  • 51
  • 1
  • 1
  • 2

5 Answers5

8

You can also set them in the preferences for the Desktop app.

As shown in figure

Jeremy Caney
  • 7,102
  • 69
  • 48
  • 77
user18322307
  • 81
  • 1
  • 2
2

I just experienced this error myself. For anyone still struggling with it:

In the GUI under File>>Options>>Git, my name and E-mail address were already listed in those fields. But when I manually clicked the "Save" button (without altering the name and E-mail address that appeared in those fields automatically), it fixed this issue for me.

My guess for why this happened to me: I just started running the desktop app as an admin to fix some permission-related errors that popped up immediately after installing. It could be that—while the app was having permission troubles—it was able to save my name and E-mail in the GUI, but couldn't apply them where they counted/were usable.

Either way, hopefully this will help someone who's stuck.

Jim
  • 21
  • 2
2
  1. Open git Bash
  2. Set an Email address in Git
$ git config --global user.email "your Email Address"
  1. Set a username in Git
$ git config --global user.name "user name of your GitHub"
Obsidian
  • 3,719
  • 8
  • 17
  • 30
ata.j
  • 21
  • 2
1

I understand I have to put my name and email in the file

It will go in your .gitconfig file (note that this is not part of the data committed to your repository).

You shouldn't need to edit it manually though. Github Desktop is telling you the commands you need to run. Just run them on the command line.

You can also set them in the preferences for the Desktop app.

Quentin
  • 914,110
  • 126
  • 1,211
  • 1,335
  • Also note that most public sites offer a representative id so your email isn't published and at least GitHub also appears to offer making your email private via a setting (presumably it rewrites the commits) https://docs.github.com/en/articles/setting-your-commit-email-address – ti7 Apr 08 '21 at 15:25
1

Setting your email address for every repository on your computer

  1. Open Git Bash.

  2. Set an email address in Git

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

done to check that, you can confirm that you have set the email address correctly in Git:

$ git config --global user.email
email@example.com
EricSchaefer
  • 25,272
  • 21
  • 67
  • 103