Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

git : empty ident name (for <>) not allowed

Tags:

git

github

I was applying a diff file of an opensource project on the top of my repository using git-am :

 git am -3 < /Downloads/refactorWork.diff 

but it had conflicts and i had to resolve them; but after resolving the conflicts and staging them, when i did git am --continue i got :

fatal : empty ident name (for <>) not allowed 

I looked up on the internet and found this which seemed to be similar to my problem but my usename and email were already added up in global and local git directories. Here is the output of git config list :

rohan@~/Documents/libo : $ git config --global --list [email protected] user.name=Rohan Kumar alias.l=log --oneline --graph --pretty credential.helper=cache 

Although i solved this by first commiting the staged changes and then using git am --skip, I am interested in knowing what does that error means and whether what i did was the correct way of doing it, or is there any better way?

like image 481
Rohan Kumar Avatar asked Jan 24 '17 16:01

Rohan Kumar


People also ask

How do I fix author identity unknown in git?

When linking a commit to a Story, you may see "Unknown Author" in the Commit section. This indicates that the email address you used in your GitHub, GitLab, or Bitbucket account doesn't match the email address you used for your Shortcut account. To correct this: Go to Settings > Your Account > Email Addresses.

How do I change my default identity?

Run git config --global user. email "[email protected]" git config --global user.name "Your Name" to set your account's default identity. Omit --global to set the identity only in this repository.


1 Answers

This diff file is a plain diff, not something generated by git format-patch. A format-patch generated diff contains information about the commit author, author date, commit message, ... and maintains this information when creating the commit(s).

Your plain diff does not have these information, so git am will complain that it is missing naturally.

You should instead have used git apply which is meant to apply simple patch files like you have in this case which will only apply the patch to the worktree (and index if you tell it to) but does not create any commit automatically.

like image 109
Vampire Avatar answered Sep 22 '22 08:09

Vampire