8

I made a mistake when I first committed. I'm on another person's computer and pushed a version with their user.name instead of mine. How can I delete this?

atomical
  • 297
  • 2
  • 5
  • 12
  • See http://stackoverflow.com/questions/750172/how-do-i-change-the-author-of-a-commit-in-git, but that involves history rewriting. – VonC Aug 07 '10 at 15:32
  • Deleting (or changing the author of) a commit that is the ancestor of other commits is inherently rewriting history. – David Winslow Aug 08 '10 at 00:19

2 Answers2

4

You can just force-push a repository containing the initial commit you want to Github using git push --force.

3

There are a lot of duplicate questions related to this. The following is a generic solution for replacing the first commit of your tree. After you perform this step, you can make any other changes using git rebase -i.

Insert a commit before the root commit in Git?

Community
  • 1
  • 1
cmcginty
  • 113,384
  • 42
  • 163
  • 163