How to resolve the Git issue - Author identity unknown
Last modified: June 7, 2024
When version-controlling a database in Git and trying to commit changes to the repository, you might encounter the error message Author Identity Unknown. This issue occurs because Git cannot recognize your email address and author identity and requires you to set a username and email address for commits in your Git configuration.
Furthermore, the Author Identity Unknown issue might trigger other errors, such as:
- error: pathspec ‘< path >’ did not match any file(s) known to git
- error: pathspec ‘011’ did not match any file(s) known to git
Note
Resolving the Author Identity Unknown issue is likely to address these associated errors as well.
To resolve this issue, you need to open the command line or terminal and run the following commands, replacing "you@example.com"
with your email and "Your Name"
with your username:
git config --global user.email "you@example.com"
git config --global user.name "Your Name"
These commands will set your username and email address as the default identity for all your Git repositories.
Note
If you want to set them for the current repository, navigate to your repository directory in the command line and run the same commands without the
--global
flag.
To ensure proper configuration, run the following commands:
git config --global user.email
git config --global user.name
These commands should display the name and email you’ve just set. After that, you can commit the changes.
Let us now consider the example, which will illustrate the issue and its resolution. We’ll begin by linking the sakila database to the sakila remote Git repository and try to commit the local changes without the username and email specified in Git configuration.
Example
1. Link the sakila database to the remote Git repository. The Source Control Manager opens, displaying the changes in database objects.
2. In the Local changes section, select the changes, add a comment, and click Commit.
3. The Commit window opens, displaying the stages of the commit operation. At the Checkin step, the operation fails with the Author identity unknown error.
The Error List pane opens, showing the description of the error and the way to resolve it.
Click OK to close the Commit progress window.
4. To resolve the issue, open the command prompt and navigate to the folder with the repository to which the database is linked.
5. In the command prompt, execute the following commands:
git config --global user.email "you@example.com"
git config --global user.name "Your Name"
Note
Replace
"you@example.com"
with your email address and"Your Name"
with your username.
If we open the configuration file, we’ll see that data has been inserted.
6. Go back to the Source Control Manager and refresh it. After the refresh operation is complete, click OK to close the window.
7. In the Local changes section, select the changes and click Commit. The Commit progress window opens, showing the stages of the operation.
Now, the operation succeeded, and the changes have been committed to the remote repository without error.
Want to find out more?
Overview
Take a quick tour to learn all about the key benefits delivered by dbForge Studio for MySQL.
All features
Get acquainted with the rich features and capabilities of the tool in less than 5 minutes.
Request a demo
If you consider employing this tool for your business, request a demo to see it in action.