CoderMonkey CoderMonkey - 11 months ago 66
Git Question

Can't commit to CodeCommit

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.
git config --global ""
git config --global "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
, so it is picking up the gut config setup as per AWS guidelines. The contents of this file are as follows:

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
part of the
file but this hasn't resolved the issue either.

Can anyone advise what I'm missing here?

Answer Source

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 "code@mon.key"
git config "Code Monkey"

and then commit:

git commit -m "test"