Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S261888AbVDKSbp (ORCPT ); Mon, 11 Apr 2005 14:31:45 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S261880AbVDKSbo (ORCPT ); Mon, 11 Apr 2005 14:31:44 -0400 Received: from w241.dkm.cz ([62.24.88.241]:50821 "HELO machine.sinus.cz") by vger.kernel.org with SMTP id S261885AbVDKSay (ORCPT ); Mon, 11 Apr 2005 14:30:54 -0400 Date: Mon, 11 Apr 2005 20:30:51 +0200 From: Petr Baudis To: "Randy.Dunlap" Cc: Linus Torvalds , pj@engr.sgi.com, junkio@cox.net, ross@jose.lug.udel.edu, linux-kernel@vger.kernel.org Subject: Re: Re: more git updates.. Message-ID: <20050411183051.GA22339@pasky.ji.cz> References: <20050409200709.GC3451@pasky.ji.cz> <7vhdifcbmo.fsf@assigned-by-dhcp.cox.net> <20050410115055.2a6c26e8.pj@engr.sgi.com> <20050410161457.2a30099a.pj@engr.sgi.com> <20050411084931.4aaf7ae0.rddunlap@osdl.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050411084931.4aaf7ae0.rddunlap@osdl.org> User-Agent: Mutt/1.4i X-message-flag: Outlook : A program to spread viri, but it can do mail too. Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1976 Lines: 49 Dear diary, on Mon, Apr 11, 2005 at 05:49:31PM CEST, I got a letter where "Randy.Dunlap" told me that... > On Sun, 10 Apr 2005 16:38:00 -0700 (PDT) Linus Torvalds wrote: ..snip.. > | Yes. Crappy old tree, but it can still read my git.git directory, so you > | can use it to update to my current source base. > > Please go into a little more detail about how to do this step... > that seems to be the most basic concept that I am missing. > i.e., how to find the "latest/current" tree (version/commit) > and check it out (read-tree, checkout-cache, etc.). Well, its ID is by convention kept in .dircache/HEAD. But that is really only a convention, no "core git" tool reads it directly, and you need to update it manually after you do commit-tree. First, you need to get the accompanying tree's id. git-pasky's shortcut is $(tree-id), but manually you can do it by $(cat-file commit $(cat .dircache/HEAD)) | egrep '^tree' Note that if you ever forgot to update HEAD or if you have multiple branches in your repository, you can list all "head commits" (that is, commits which have no other commits referencing them as parents) by doing fsck-cache. Now, you need to populate the directory cache by the tree (see Paul Jackson's diagram): read-tree $tree_id And now you want to update your working tree from the cache: checkout-cache -a -f This will bring your tree in sync with the cache (it won't remove any stale files, though). That means it will overwrite your local changes too - turn that off by omitting the "-f". If you want to update only some files, omit the "-a" and list them. -- Petr "Pasky" Baudis Stuff: http://pasky.or.cz/ 98% of the time I am right. Why worry about the other 3%. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/