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?
Asked
Active
Viewed 1.3k times
8
-
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 Answers
4
You can just force-push a repository containing the initial commit you want to Github using git push --force
.

Olaf Muller
- 89
- 2
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
.