Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

delete first git commit

Tags:

git

github

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?

like image 956
atomical Avatar asked Aug 07 '10 14:08

atomical


2 Answers

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

like image 195
Olaf Muller Avatar answered Oct 14 '22 13:10

Olaf Muller


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?

like image 24
cmcginty Avatar answered Oct 14 '22 14:10

cmcginty