{"thread":{"id":"14115","subject":"Re: why is git destructive by default? (i suggest it not be!)","startedAt":"2008-06-24T04:59:37Z","lastAt":"2008-06-24T05:43:13Z","messageCount":2,"participants":["Teemu Likonen"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"80828","messageId":"20080624045937.GA3125@mithlond.arda.local","threadId":"14115","inReplyTo":null,"subject":"Re: why is git destructive by default? (i suggest it not be!)","fromName":"Teemu Likonen","fromEmail":"tlikonen@iki.fi","sentAt":"2008-06-24T04:59:37Z","receivedAt":"2008-06-24T04:59:37Z","isPatch":false,"sender":{"key":"tlikonen@iki.fi","avatar":null},"body":"David Jeske wrote (2008-06-24 01:47 -0000):\n\n> As a new user, I'm finding git difficult to trust, because there are\n> operations which are destructive by default and capable of\n> inadvertently throwing hours or days of work into the bit bucket.\n\nI'm also quite new and I actually feel safe using git, and it's because\nof reflog. No matter what I do (except manual reflog expire) I can see\nwhere I was before with command\n\n  git log --walk-reflogs\n\nand get everything back. I have needed it a couple of times. So the\nsafety net is there, one just has to learn to trust it. :-)\n\nGit is much safer than the standard Unix tools like rm, mv and cp.\n"},{"id":"80834","messageId":"20080624054313.GB3125@mithlond.arda.local","threadId":"14115","inReplyTo":"e80d075a0806232201o3933d154he2b570986604c30a@mail.gmail.com","subject":"Re: why is git destructive by default? (i suggest it not be!)","fromName":"Teemu Likonen","fromEmail":"tlikonen@iki.fi","sentAt":"2008-06-24T05:43:13Z","receivedAt":"2008-06-24T05:43:13Z","isPatch":false,"sender":{"key":"tlikonen@iki.fi","avatar":null},"body":"David Jeske wrote (2008-06-23 22:01 -0700):\n\n> On Mon, Jun 23, 2008 at 9:59 PM, Teemu Likonen <tlikonen@iki.fi>\n> wrote:\n> \n> > I'm also quite new and I actually feel safe using git, and it's\n> > because of reflog. No matter what I do (except manual reflog expire)\n> > I can see where I was before with command\n> >\n> >  git log --walk-reflogs\n> \n> \n> Perhaps I'm misunderstanding how to read it, but how do you tell where\n> a branch was from the reflog if you inadvertantly moved it?\n\nPerhaps I'm misunderstanding what you mean but I try to explain. In git\nbranches are nothing but named pointers to certain commit. If you \"move\na branch\" you actually rename the pointer, nothing more. With command\n\n  git log --walk-reflogs --all\n\nyou can see everything in your reflog. When branches are moved (i.e.,\nrenamed) in \"git log --walk-reflogs\" output it shows like this:\n\n  commit 269f10bca2273c1cf77831d5e23c6e0361217697\n  Reflog: refs/heads/master@{2008-06-24 08:15:56 +0300} (Teemu Likonen <tlikonen@iki.fi>)\n  Reflog message: Branch: renamed refs/heads/master to refs/heads/testbranch\n  Author: Teemu Likonen <tlikonen@iki.fi>\n  Date:   2008-03-25 19:10:40 +0200\n  \n  [commit message]\n\nSee the \"Reflog message\" field above. It tells what happened. The\n\"Reflog\" field tells when it happened. If I later remove this\n\"testbranch\" I can browse the reflog and create this branch (i.e.\na pointer) again with command \"git branch testbranch 269f10bca\". The\n269f10bca comes from the commit ID of the above log item.\n"}]}