Re: Checkout first version of each file?

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

 



Dario Rodriguez <soft.d4rio@xxxxxxxxx> writes:

> So, how can I checkout the first version of each file? (I know that
> GIT tracks contents and not files, but the fact is that I need to keep
> track on files, it's the real thing I work with)

In general "the first version of a file" is an undefined concept if your
history has merges of parallel development, but in a narrow special case
of linear history, you should be able to do something like this:

    $ git log --format='# %h %s' --diff-filter=A --raw --abbrev=40

which would give you something like

    # 8d19b44 Git 1.7.7.2

    :000000 100644 0000000... e6bbef2... A  Documentation/RelNotes/1.7.7.2.txt
    # 0f77dea mingw: move poll out of sys-folder

    :000000 100644 0000000... 708a6c9... A  compat/win32/poll.c
    :000000 100644 0000000... b7aa59d... A  compat/win32/poll.h
    # 8f41c07 read-cache.c: fix index memory allocation

    :000000 100755 0000000... bca359d... A  t/t7511-status-index.sh
    ...

so that you know what blobs to check out to which path. E.g.

    $ mkdir -p compat/win32; git cat-file blob 708a6c9... >compat/win32/poll.c

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