[Numpy-discussion] Can we freeze the subversion repository and move to github this week?

Gael Varoquaux gael.varoquaux@normalesup....
Wed Sep 15 08:09:30 CDT 2010


On Wed, Sep 15, 2010 at 09:54:24PM +0900, David Cournapeau wrote:
> The basic way to use reflog is trivial: it just keeps a (time ordered)
> list of your commits and actions, independently of the branch. So for
> example, say you are in master, and by accident, you do:

> git reset --hard origin/master # origin/master is behind master
> git reflog

> will look like:

> b59aa8c HEAD@{0}: origin/master: updating HEAD
> ad5c0c0 HEAD@{1}: pull github master: Fast forward
> d11b913 HEAD@{2}: commit: ENH: add builder override support for
> compiled libraries.
> 2423a03 HEAD@{3}: commit: FEAT: add get_compiled_libraries to get all
> clib from all subpackages.
> ae4c57b HEAD@{4}: merge tmp: Fast forward
> f4c4b53 HEAD@{5}: github/master: updating HEAD
> ae4c57b HEAD@{6}: checkout: moving from tmp to master
> ae4c57b HEAD@{7}: checkout: moving from
> ae4c57bab5583759aab831eafce0c9b83a5f9c45 to tmp
> ...

I don't understand which line corresponds to the 'reset --hard' in the
above reflog (sorry, I am slow). Is it the 'updating HEAD' one?

Reading the above, it seemed to me that I could always revert my previous
action (unless it impacted non-tracked files) using:

    git checkout HEAD@{0}

I just tried it on a copy of a repo I had, and I get "You are in a
'detached HEAD'". From what I understand from the message (and Google) I
simply need to do a "git checkout -b new_branch" to be in a state where I
can work. However, it seem to me that when I switch back the the master
branch, and merge my new_branch, I haven't "undone" the action I was
trying to undo.

Sorry for asking these questions, but I'd rather be dense and ask them
while I am playing with a toy repo than suffer from my git inability
later on a real situation, which usually happens at 2AM.

Thanks for you git-foo

Gaël


More information about the NumPy-Discussion mailing list