3

I did a little editing in a file on my GitHub repository through the website and then committed the changes. It's not like changing a file, committing and then pushing it to the origin, I did it directly by going to the website. Now there are two commits in that branch. Can I squash the last commit from the terminal? If not, is there any way I can squash it from the GitHub website?

I'm not a native English speaker. So, pardon my bad English.

  • Possible duplicate of [Remove specific commit](http://stackoverflow.com/questions/2938301/remove-specific-commit) – nipeco Dec 03 '15 at 15:48

1 Answers1

3

I don't think you can do it from the website itself. But you can do it from the terminal.

# Pull in the remote changes
$ git pull

# Rebase the last 2 commits interactively
$ git rebase -i HEAD~2
pick abcdef commit to keep
squash 123456 commit to squash

# Override the remote branch
$ git push -f origin <branch> 
Tom Verelst
  • 15,324
  • 2
  • 30
  • 40