Re: Git checkout preserve timestamp?
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Mar 1, 2007, 22:13 UTC
- Message-ID
- <Pine.LNX.4.63.0703012304200.22628@wbgn013.biozentrum.uni-wuerzburg.de>
- In-Reply-To
- <17895.18265.710811.536526@lisa.zopyra.com>
Hi Bill,
On Thu, 1 Mar 2007, Bill Lear wrote:
> I often find myself in branch A, with everything checked in and > compiled, wanting to look at something on branch B.
I did that, too, until git-show learnt about the nice ":" syntax.
For example, if I want to know what is in branch B, I do
$ git show B:
which shows the root directory of the revision "B" (this is in line with <commit>:<pathspec> if you interpret "" as the root path). The subtrees are all identified by trailing slashes. Then you can say
$ git show B:Documentation/Makefile
If you want to know the differences to the file "doc/GNUMakefile" in your current working tree, do
$ git diff B:Documentation/Makefile -- doc/GNUMakefile
No need to switch branches.
And if you _do_ need to switch branches, why not make a local clone, sharing the object database:
$ git clone -l -s . test-directory
This is _very_ fast, since it basically checks out the branches in test-directory/. Right now, you have to go to the test-directory, and switch the branches manually (I think), but talk has been that you may be able to tell git-clone which branch you really want.
Hth, Dscho