在git repo中验证行结束 [英] Verify line ending in git repo

查看:129
本文介绍了在git repo中验证行结束的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有什么办法来验证git仓库中的文件的行尾?如果我签出,那么工作目录可能会受到core.autocrlf或.gitattributes等的影响。



有没有像svn get那样没有签出但只是将某个文件从存储库复制到某处的本地文件系统(假设这会忽略任何行结束转换设置)?

解决方案


如果我签出,那么工作目录会受到core.autocrlf或.gitattributes的影响,等等。


是的,它可以。


有什么像svn get那样没有签出,只是简单地将一个文件从存储库复制到我的本地文件系统中某处

您可以要求提供一个repo的git存档文件:这是在存档中压缩的一个给定提交文件(zip或tar)。

一些主机服务提出这样的建议(如GitHub及其下载ZIP 按钮



当你压缩这样的压缩文件时,根本不会修改eol(它不是一个git repo,只是一组文件)。

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)?

解决方案

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).

这篇关于在git repo中验证行结束的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆