I've got a git repository where I'm the only committer, so far, and that has already been published on github. I found that a few commits, being done from a different computer, has the wrong author information. My idea was to remove the repository from github, rewrite history and republish it as new. For such purpose I've created a simple script:
git filter-branch --commit-filter '
GIT_COMMITTER_NAME="Author Name";
GIT_AUTHOR_NAME="Author Name";
GIT_COMMITTER_EMAIL="email";
GIT_AUTHOR_EMAIL="email";
git commit-tree "$@";
' HEAD
which should rename all commits. The problem is that git replies with
Cannot rewrite branch(es) with a dirty working directory.
but a git status provides me
# On branch master
nothing to commit (working directory clean)
Any idea about what am I missing? Any suggestion on how to rename all commits without loosing the history will be appreciated.