[gmx-developers] Re: accidental commit to gromacs public repository?

Michael Shirts mrshirts at gmail.com
Tue Jan 5 03:29:28 CET 2010


That's what I was afraid of!

It seems that there should be some sort of single command that one can
perform on the public repository to just revert the last commit and
merge (as can be done with a bad "git pull") as opposed to
individually reverting all the commits in a local repository, and
pushing a new single commit with all the edits. Isn't the whole point
of reversion control to be able to quickly recover from errors?

I've now tried individually going through and deleting all my
revisions, but haven't been able to find a combination of
specification of merge mainlines that actually returns the repository
to the condition it was right.

At least the code should only change results with keywords introduced
after 4.0, so it won't be a total disaster for me to address
individual changes.

grr . . . .

------------------------------------------------------
You probably can't do anything. One can change pretty much anything
before any other repo has pulled from the one to which you committed
erroneously. However once anybody has pulled, your "undo" changes risk
trashing their repository.

"git revert" is used in this case to record a new commit to undo cleanly
the effect of the erroneous one. You can experiment with its usage by
pushing the error to gromacs_mrs, reverting on your working repo, and
pushing again to gromacs_mrs.

One workflow that helps avoid this is to have gromacs_mrs a clone of the
official repo, and you clone gromacs_mrs to your working repo. origin
points to the clone origin, not the ancestor. Now all you need to do is
take care you know which repo you're in when you "git push origin" (not
too hard!). Alternatively, you can edit .git/config to change the label
of origin wrt gromacs_mrs to something that you won't type unthinkingly
- like "gromacscentralmaster" etc.

Mark



More information about the gromacs.org_gmx-developers mailing list