2

I'm not able to commit any files to my new CodeCommit repository, not sure why.

I've been able to clone my repository, so I'm able to connect to it. This would seem to rule out authentication issues. However, once I add and then commit a file I get the following error:

$ git commit -m "test"
*** Please tell me who you are.
Run
git config --global user.email "you@example.com"
git config --global user.name "Your Name"
to set your account's default identity.
Omit --global to set the identity only in this repository.
fatal: empty ident name (for <(null)>) not allowed

I've created an IAM user with the AWSCodeCommitPowerUser policy attached to it. This is the user currently configured by calling aws configure on the command line.

I've checked git config --global -l and it does return the contents of .gitconfig, so it is picking up the gut config setup as per AWS guidelines. The contents of this file are as follows:

[credential]
    helper = !aws codecommit credential-helper --profile=IAMUserName $@
    UseHttpPath = tru

I'm really not sure what I'm missing here. I can connect to the repository and clone it, and my config looks to match the contents of the tutorial but I can't commit. I've tried removing the --profile part of the .gitconfig file but this hasn't resolved the issue either.

Can anyone advise what I'm missing here?

hjpotter92
  • 78,589
  • 36
  • 144
  • 183

1 Answers1

4

As stated by the error message, you are not able to sign-off your commits without specifying an author name and email address.

Execute the following commands in the repository before committing:

git config user.email "code@mon.key"
git config user.name "Code Monkey"

and then commit:

git commit -m "test"
hjpotter92
  • 78,589
  • 36
  • 144
  • 183
  • 1
    Many thanks to all. This wasn't covered in the first commit document I was reading but after googling user.email I see this is covered in the link below (as described in this answer). Linked for reference: http://docs.aws.amazon.com/codecommit/latest/userguide/getting-started.html – CoderMonkey Nov 08 '16 at 16:00