user532339
user532339

Reputation:

Remove GitHub commit history for particular day

Was wondering is it possible to remove GitHub commit history for a particular day. I.E. I have the following: Imgur is it possible to remove these two particular commits from my history. I do not want to remove ALL of my history just part of it. I believe I will have to specify which commit I would like to remove. If someone can point me in the right direction thank you

Upvotes: 2

Views: 587

Answers (1)

Jonah
Jonah

Reputation: 17958

I think this is answered well in How to remove selected commit log entries from a Git repository while keeping their changes?

How you want to proceed should depend on who has seen the commits you want to remove. Rewriting history is very disruptive to anyone who is working on the affected branches. Talk to anyone else who is working on this repository and make sure you do not accidentally orphan branches when you rewrite history.

For a simple case the interactive rebase described in the link above should be sufficient. If the commits you wish to remove are included in multiple branches (and you want to preserve all of those branches) then you may want to consider using the filter-branch command for an even broader and more aggressive rewrite of history (https://help.github.com/articles/remove-sensitive-data may be a good introduction but doesn't cover this specific case).

Upvotes: 2

Related Questions