Verify line ending in git repo

故事扮演 提交于 2019-12-23 01:17:31

问题


Is there any way to verify the line endings for a file in the git repo? If I checkout then the working directory can be influenced by core.autocrlf or .gitattributes, etc.

Is there anything like "svn get" that doesn't checkout but simply copies a file from the repository to my local filesystem somewhere (assuming this ignores any line ending conversion settings)?


回答1:


If I checkout then the working directory can be influenced by core.autocrlf or .gitattributes, etc.

yes, it can.

Is there anything like "svn get" that doesn't checkout but simply copies a file from the repository to my local filesystem somewhere

You can ask for a git archive of a repo: that is the files of a given commit compressed in an archive (zip or tar).
Some hosting services propose just that (like GitHub and its Download ZIP button)

When you uncompressed such an archive, no eol is modified at all (it isn't a git repo, just a collection of files).



来源:https://stackoverflow.com/questions/25697254/verify-line-ending-in-git-repo

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!