Home > Software engineering >  Remove old commit preserving changes
Remove old commit preserving changes

Time:06-18

I started editing a project downloaded from a glitch repository I played around for a little bit. A lot of automatic commits were done before I downloaded the project and continued editing it locally. The issue is that the automatic commits probably contain sensitive information (like my phone number or a url with an access token) I don't want showing up on the repository, plus it makes the project look a bit messy.

I want to keep 749bcc4 and later and delete cd1ee76 and earlier commits from the repo without affecting the newer ones.

My git log now looks like this:

<17 more recent commits made by me>
4dea670 (Supress logs during tests, 2022-06-04)
8915b33 (Webhook subsciption tests, 2022-06-04)
f189b0b (Functioning test template with chai-http added, 2022-06-04)
749bcc4 (Replies automatically to every message received, 2022-06-04) <-- I pickup the project and get serious about it
cd1ee76 (           
  • Related