Tell git that a text file is actually binary

I committed a few PDF files into a git repository and it looks like git treated it as text and not binary. So what's in the repo is almost 1k larger than the source and no longer displays correctly.

I updated my .gitattributes file to include PDF files as binary, but the damage already seems to be done on the files in the repo. Is there any way to tell git to re-add the PDFs as binary? Would be best solution be to remove the files from the repo and re-add them?


yes, remove and add back should work.

Committing a new version on top after you've added the .gitattributes file should be enough. The removing step should not be required.

链接地址: http://www.djcxy.com/p/69304.html

上一篇: FOSUserBundle注册自定义

下一篇: 告诉git文本文件实际上是二进制文件