* Master branch not updating
@ 2010-03-22 16:43 Jacopo Pecci
2010-03-22 16:47 ` Thomas Rast
2010-03-22 17:17 ` Johannes Sixt
0 siblings, 2 replies; 4+ messages in thread
From: Jacopo Pecci @ 2010-03-22 16:43 UTC (permalink / raw)
To: git
Hi,
I have a simple local project, with only the master branch. After few
commits with Git Extensions, I have realized the label [master] was
stuck, it was not pointing at the latest commit any more. Nevertheless
I could see a full list of all my new commits with the proper comments
in the main window. It looked like I was not on any branch (if this
is possible)
Then I have tried “checkout master branch”, suddenly all the commits
in between the one labelled [master] and the latest one vanished. I
have not been able to get back.
I am terribly afraid I have lost 4 day work. Do you have any
suggestion? How is it possible that something which I have committed
is not retrievable anymore.
I beg someone to help me
Thanks, Jacopo
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Master branch not updating
2010-03-22 16:43 Master branch not updating Jacopo Pecci
@ 2010-03-22 16:47 ` Thomas Rast
2010-03-22 17:17 ` Johannes Sixt
1 sibling, 0 replies; 4+ messages in thread
From: Thomas Rast @ 2010-03-22 16:47 UTC (permalink / raw)
To: Jacopo Pecci; +Cc: git
Jacopo Pecci wrote:
> Hi,
> I have a simple local project, with only the master branch. After few
> commits with Git Extensions, I have realized the label [master] was
> stuck, it was not pointing at the latest commit any more. Nevertheless
> I could see a full list of all my new commits with the proper comments
> in the main window. It looked like I was not on any branch (if this
> is possible)
> Then I have tried “checkout master branch”, suddenly all the commits
> in between the one labelled [master] and the latest one vanished. I
> have not been able to get back.
>
> I am terribly afraid I have lost 4 day work. Do you have any
> suggestion? How is it possible that something which I have committed
> is not retrievable anymore.
Read this very nice article by Sitaram Chamarty:
http://sitaramc.github.com/concepts/detached-head.html
--
Thomas Rast
trast@{inf,student}.ethz.ch
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Master branch not updating
2010-03-22 16:43 Master branch not updating Jacopo Pecci
2010-03-22 16:47 ` Thomas Rast
@ 2010-03-22 17:17 ` Johannes Sixt
2010-03-23 7:34 ` Jacopo Pecci
1 sibling, 1 reply; 4+ messages in thread
From: Johannes Sixt @ 2010-03-22 17:17 UTC (permalink / raw)
To: Jacopo Pecci; +Cc: git
Am 3/22/2010 17:43, schrieb Jacopo Pecci:
> Then I have tried “checkout master branch”, suddenly all the commits
> in between the one labelled [master] and the latest one vanished. I
> have not been able to get back.
>
> I am terribly afraid I have lost 4 day work. Do you have any
> suggestion? How is it possible that something which I have committed
> is not retrievable anymore.
1. Don't panic.
2. Make a backup copy, *including* the .git directory (very important!)
The .git directory contains your 4 day work, and it is very likely still
retrievable.
It may be a simple matter of
git branch the-lost-state HEAD@{1}
If you can't work on a command line, then git extensions certainly has
some nice UI that lets you create a branch at a particular revision. In
this case, the branch name is "the-lost-state", and the revision is HEAD@{1}.
You can try more branch names at HEAD@{2}, HEAD@{3} (you get the point).
It means, roughly, "the state where HEAD was 1, 2, 3, etc. git operations
ago".
-- Hannes
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Master branch not updating
2010-03-22 17:17 ` Johannes Sixt
@ 2010-03-23 7:34 ` Jacopo Pecci
0 siblings, 0 replies; 4+ messages in thread
From: Jacopo Pecci @ 2010-03-23 7:34 UTC (permalink / raw)
To: Johannes Sixt; +Cc: git
THANK YOU! THANK YOU! THANK YOU! THANK YOU! THANK YOU!
I managed to recover all and actually the article made me understand a
bit more Git.
Jacopo
On Mon, Mar 22, 2010 at 7:17 PM, Johannes Sixt <j.sixt@viscovery.net> wrote:
> Am 3/22/2010 17:43, schrieb Jacopo Pecci:
>> Then I have tried “checkout master branch”, suddenly all the commits
>> in between the one labelled [master] and the latest one vanished. I
>> have not been able to get back.
>>
>> I am terribly afraid I have lost 4 day work. Do you have any
>> suggestion? How is it possible that something which I have committed
>> is not retrievable anymore.
>
> 1. Don't panic.
>
> 2. Make a backup copy, *including* the .git directory (very important!)
>
> The .git directory contains your 4 day work, and it is very likely still
> retrievable.
>
> It may be a simple matter of
>
> git branch the-lost-state HEAD@{1}
>
> If you can't work on a command line, then git extensions certainly has
> some nice UI that lets you create a branch at a particular revision. In
> this case, the branch name is "the-lost-state", and the revision is HEAD@{1}.
>
> You can try more branch names at HEAD@{2}, HEAD@{3} (you get the point).
> It means, roughly, "the state where HEAD was 1, 2, 3, etc. git operations
> ago".
>
> -- Hannes
>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-03-23 7:34 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-22 16:43 Master branch not updating Jacopo Pecci
2010-03-22 16:47 ` Thomas Rast
2010-03-22 17:17 ` Johannes Sixt
2010-03-23 7:34 ` Jacopo Pecci
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).