Fix unrecognized commits
  • Updated on 11 Nov 2019
  • 1 minute to read
  • Contributors
  • Share
  • Dark
    Light

Fix unrecognized commits

  • Share
  • Dark
    Light

When an author or committer’s email is not configured correctly, the commit is not associated with the correct user, and it is almost impossible to trace who is responsible for which piece of code.

3x-61dac9a-a5fdd0ca-f22b-481e-881d-185c5de317f9.png

To troubleshoot the root cause do the following:

Make sure the listed email address is your correct email address

3x-e7371e1-670ef69d-f614-4246-be03-cbe3977ad45b.png

➡️ If this email address is correct
➡️ If this email address is incorrect

A. Adding an email address to your GitHub account

  1. Follow the steps in this guide
  2. Re-run the policy

3x-5fc9c07-a200e971-bdf0-4d78-91f6-55e58f6f59c9.png

B. Updating your git configuration settings

  1. Open command line inside the git dir and type the following
$ git  config  --global  user.email

Is the listed email address in the terminal is correct?

No - This is not my correct email address

Set your username and email address:

$ git  config  --global  user.email johndoe@example.com
$ git  config  --global  user.name  "John Doe" 

Yes - This is my correct email address

You have a local git config file inside your repository dir which overwrites your global git config - fix it

  1. Rewrite your commit(s) history
  2. Push the changes to the remote branch - Datree automatically scans your changes.
Was this article helpful?