Re: Lost a week?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Daniel Grace venit, vidit, dixit 15.04.2010 15:57:
> Appologies for not having more information. I usually use git as if
> it's just SVN with non-network checkins.
> 
> A few days ago, I pushed my git repository to github:
> 
> 127  git remote add github
> git@xxxxxxxxxx:negativeview/Wherespresso.git [Note, this is a private
> repo]
> 128  git push github master
> 
> I then went about doing real-world business. I noticed at some point
> that when I did a `git status` it said that no branches were checked
> out. I don't remember doing anything between pushing to github and
> this state. If I did a git branch it shows something like * (no
> branch) then below that, master. I shrugged it off and did what I
> expected to fix that odd issue:
> 
> 515  git branch
> 516  git checkout master
> 
> Now, the next day, I noticed that I have no git history between the
> 6th and something I did soon after the git checkout master:
> 
> $ git log | grep Date | head -n 5
> Date:   Wed Apr 14 14:43:58 2010 -0500
> Date:   Tue Apr 6 00:42:20 2010 -0500
> Date:   Mon Apr 5 23:57:54 2010 -0500
> Date:   Mon Apr 5 07:01:26 2010 -0500
> Date:   Mon Apr 5 06:17:18 2010 -0500
> 
> github shows the same. I KNOW that there were commits (representing a
> good bit of work) in that time. I'm sure that it's *somewhere* but I'm
> at a complete loss as to where it is. gitk shows no side branches (nor
> does git branch). I don't use branches really, as much as I know that
> I should.
> 
> Daniel
> http://www.doomstick.com

Backup now.

Most probably, you've made those commits on a detached HEAD. May you
have checked out a remote branch, or a specific commit, before you went
about your business on or after 6th?

git reflog (or git log -g) will be able to show you the history of your
HEAD before you lost it ;)

Then you can tag those commits or 'checkout -b safehaven
nameofthetopcommit' to get a branch with those commits. Now they are
safe from being pruned during garbage collection.

Michael
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]