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:
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 BikeStores database to the bikestores remote Git repository. Then, we’ll make the changes to the table and try to commit them without the username and email specified in Git configuration.
1. Link the BikeStores database to the remote Git repository.
2. Modify the dbo.Orders table and refresh the Source Control Manager.
3. In the Local changes section, select the change, add a comment, and click Commit.
4. 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.
5. To resolve the issue, open the command prompt and navigate to the folder with the repository to which the database is linked.
6. 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.
7. Go back to the Source Control Manager and refresh it. After the refresh operation is complete, click OK to close the window.
8. 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.