RobertEves92
RobertEves92

Reputation: 145

Remove multiple duplicate git commits

Having run commands to change my author name on my repo I am now left with almost every single commit existing with both old and new author names.

How do I remove all the duplicate commits so that only one version of everything exists using only one author name?

WTF?!

Upvotes: 0

Views: 323

Answers (1)

j6t
j6t

Reputation: 13387

Assuming you have used git filter-branch, the original commits are available from, e.g., refs/original/refs/heads/master. The rewritten ones are under refs/heads/master aka master. (Insert other branch names if you have them.)

If you clone the repository into a new directory, you should receive only master, i.e., the rewritten commits.

You can also delete the original commits using

git update-ref -d refs/original/refs/heads/master

Upvotes: 1

Related Questions