Re: Git checkout preserve timestamp?

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

 



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

-
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]