[mythtv] GIT reverts accidentally committed

Daniel Kristjansson danielk at cuymedia.net
Wed Feb 22 21:38:48 UTC 2012

On Wed, 2012-02-22 at 10:52 +1100, Nigel Pearson wrote:
> >> % git reset --hard a5fcdea9779f8ad1821ee741fe99c9032c2c51a6
> >> HEAD is now at a5fcdea don't let stash cause failures
> >> % git push -f
> ...
> >> To git at github.com:MythTV/packaging.git
> >>  + 30acaf3...a5fcdea master -> master (forced update)
> > 
> > GAH!  This is the way to clean it up, yes, but now you have buggered
> > up everyone who has downloaded with your errant changes in there.
> Oops. Do "git pull"s now fail?

Yeah, anyone that pulled the bad change has to manually repair their
repo. The proper thing to do is to just reverse all the changes. As
you found out git revert has problems if there is a merge involved
because it doesn't know which parent tree is 'trunk'; but it is still
possible to create a patch manually. (There is probably some git magic
to tell revert what to do, but I don't know it.)

As a rule you should only get rid of commits completely while they
are still only in your local tree. After that you want to commit
something new to do undo the damage.

-- Daniel

More information about the mythtv-dev mailing list