1

I have a git repository with lots of revisions. I'm the only developer, so all commits are from me so far. Somehow, I ended up with a single commit that has no ident information. I tried running:

git filter-branch --env-filter '
>> GIT_AUTHOR_NAME=myusername
>> GIT_AUTHOR_EMAIL=myuseremail@website.com
>> export GIT_AUTHOR_NAME
>> export GIT_AUTHOR_EMAIL

but I keep getting this error:

rewrite deadbeefdeadbeefdeadbeefdeadbeefdeadbeef (112/123)fatal: empty ident name (for ()) not allowed
could not write rewritten commit
rm: cannot remove '/c/some/directory/that/leads/to/my/repository/.git-rewrite/revs': Permission denied
rm: cannot remove directory '/c/some/directory/that/leads/to/my/repository/.git-rewrite': Directory is empty

what am I doing wrong? Everything I see online about ident tells you how to fix commits before you make them: what do you do after the commit is already through?

benjamin.popp
  • 547
  • 1
  • 6
  • 20
  • 1
    I don't know if this can be of help, but have you checked the last section of this page: [git-book](http://git-scm.com/book/en/Git-Tools-Rewriting-History)? It talks about changing the e-mail after commit. – triple_r Jun 27 '14 at 04:27

1 Answers1

1

To be sure, I would set AUTHOR and COMMITTER, and use git commit-tree, to record the change.

You can see a full example in "Change the author of a commit in Git".

Note: to reset your filter-branch, you might have to:

  • exit your git bash
  • delete the .git-rewrite folder.
Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250