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

Roland Schulz roland at utk.edu
Tue Jan 5 03:25:17 CET 2010


Hi,

I agree. You can't remove the commits from the log without risking to
corrupt it for other people. If you would know that no one has pulled you
could do rewrite the history (using rebase/reset with forced push) to remove
it from the log.
But since you don't, you need to generate a new commit which undoes the
wrong commits. For a single(/a few) you can use git-revert.

In this case the easiest was:
git log 9bc2b6815a4253eb4c25070f3e830e..
to see that I got the correct id (I took it from the commit email)
and then:
git diff HEAD 9bc2b6815a4253eb4c25070f3e830e | git apply
to generate the undo commit.

Michael, please check that I did it correct and didn't undo too much. Just
look at the git log output (or my commit message) and check that I didn't
revert any commit which was not supposed to be undo. I did check that I
didn't revert anything from anyone but Michael, so all commits by everyone
should be fine.

Roland


On Mon, Jan 4, 2010 at 8:23 PM, Mark Abraham <Mark.Abraham at anu.edu.au>wrote:

> Michael Shirts wrote:
>
>> Hi all-
>>
>> I accidentally ran a "git push origin" to the public repository
>> instead of a "git push gromacs_mrs" (my 'private' public repository),
>> and after a couple of hours of googling, am still not sufficiently
>> certain I know to revert a push to a public repository without messing
>> everyone up that I'm willing to try it.  The European developers seem
>> to have gone to bed, so if anyone else feels confident in their
>> knowledge of git, please let me know!  Or alternately, you might want
>> to avoid pulling any changes tonight.  Apologies for the
>> inconvenience!
>>
>
> 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
>
> --
> gmx-developers mailing list
> gmx-developers at gromacs.org
> http://lists.gromacs.org/mailman/listinfo/gmx-developers
> Please don't post (un)subscribe requests to the list. Use the www interface
> or send it to gmx-developers-request at gromacs.org.
>



-- 
ORNL/UT Center for Molecular Biophysics cmb.ornl.gov
865-241-1537, ORNL PO BOX 2008 MS6309
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://maillist.sys.kth.se/pipermail/gromacs.org_gmx-developers/attachments/20100104/cbb71ac1/attachment.html>


More information about the gromacs.org_gmx-developers mailing list