0

I created a software and saved some informations in a file. I pushed everything to github and after 9 commits I saw that this file was also pushed to github. I changed the .gitignore so that file isnt pushed anymore.

The problem is now that the information can be seen in the first 10 commits...

Can I somehow delete the first 10 commits and nothing else? (So that my 11th commit would be the first one. I already have more commits)

sirzento
  • 537
  • 1
  • 5
  • 23

1 Answers1

4
  • You can run rebase interactively by adding the -i option to git rebase. You must indicate how far back you want to rewrite commits by telling the command which commit to rebase onto.
git rebase -i HEAD~10
KennetsuR
  • 704
  • 8
  • 17
  • i dont get it. I see my latest commits when running this command. I also dont know what I need to do when the editor is open – sirzento Apr 01 '21 at 11:24
  • @sirzento you can change commit message, just like edit merge conflict commit message. – KennetsuR Apr 01 '21 at 15:07