0

Trying to delete commit entries in my remote github repo. How can I keep the last 5 commits and delete the others? I tried this:

How to remove selected commit log entries from a Git repository while keeping their changes?

After 'git log' on my local machine it looks like I got the result but after 'git push origin' I checked my github and the older commits were still there?

Edit: I just tried this :

git rebase -i HEAD~5

The editor comes up , I close it. When I say 'git log' it did not reduce the number of commits to 5?

Community
  • 1
  • 1
Pindakaas
  • 4,159
  • 15
  • 45
  • 80
  • 1
    "The editor comes up , I close it" - You are supposed to edit it - set which commits you want to skip. Docs: http://git-scm.com/docs/git-rebase#_interactive_mode – Messa Apr 26 '15 at 23:12

1 Answers1

0

You have to force-push:

git push -f origin
Messa
  • 21,202
  • 4
  • 52
  • 73