Re: git cat-file blob does not convert crlf

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

 



"Quim K. Holland" <qkholland@xxxxxxxxx> writes:

> I think git is buggy.

Thanks for pointing it out X-<.

> I wanted to discard the changes I made to my file by checking out a copy from the last commit, so I said
> % git cat-file blob HEAD:my-file >my-file
> But this does not respect core.autocrlf and the file becomes one long line.

That is pretty much intentional.  cat-file is a low-level command that is
meant to inspect the raw object contents.  The output from the command has
to be reproducible regardless of what customization you have in your
particular repository and omission of attributes support (including the
crlf conversion) is quite deliberate.

You said that you wanted to discard the changes by checking out a copy out
of the HEAD commit.  This can literally be done by:

	$ git checkout HEAD my-file

If you want to check out a copy out of the index (i.e, "the last staged
version"), you can say:

	$ git checkout my-file

In other words, if you want to checkout, you can say checkout ;-)
--
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]

  Powered by Linux