Arnis L. Arnis L. - 1 year ago 143
Git Question

Git: permanently remove few commits from remote branch

I know that's rewriting of history which is bad yada yada.

But - how to do that?

Answer Source

You 'git reset' your local branch, and you git push --force your revised local branch to the remote. (other solution here, involving deleting the remote branch, and re-pushing it)

This SO answer illustrates the danger of such a command, especially if people depends on the remote history for their own local repos.
You need to be prepared to point out people to the RECOVERING FROM UPSTREAM REBASE section of the git rebase man page

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download