git:如何将其 git 存储库中的 .git 属性部署到客户端?
git: how to deploy .gitattributes from its git repository to the client?
晚上好
我们有一个 git 存储库:
…\repository\.git\
…\repository\any repository dirs\
并且我们必须强制所有用户在复制我们的存储库时自动在 .git 属性中获得此配置:
# Disable all EOL conversation on checkout to the working directory
* -text
我理解 documentation 。git 存储库的属性必须保存在这里:
…\repository\.git\info\.gitattributes
不幸的是,它看起来像“.git\info\.gitattributes”不是存储库本身的一部分:-(
因此我们有这个奇怪的问题:
如果配置不是存储库的一部分,我们如何自动将 git 存储库配置部署到客户端?
非常感谢您的帮助!
亲切的问候,汤姆
非常感谢,@paulsm4,您的回答 - 但这不是解决方案。
经过更多调查,我找到了这个答案:
- .gitattributes 可以放在存储库根目录中(与 .git 目录平行),然后将 .gitattributes 应用于此存储库的所有已处理文件。
- .git属性也可以放在任意子目录下,只作用于该子目录下的文件
- .git/info/attributes 可以使用它一个不想提交到存储库的属性文件
因此,我的问题的答案是:
…\repository\.git\
…\repository\.gitattributes » will we applied to all handled files in the repository
亲切的问候,
汤姆
晚上好
我们有一个 git 存储库:
…\repository\.git\
…\repository\any repository dirs\
并且我们必须强制所有用户在复制我们的存储库时自动在 .git 属性中获得此配置:
# Disable all EOL conversation on checkout to the working directory
* -text
我理解 documentation 。git 存储库的属性必须保存在这里:
…\repository\.git\info\.gitattributes
不幸的是,它看起来像“.git\info\.gitattributes”不是存储库本身的一部分:-(
因此我们有这个奇怪的问题: 如果配置不是存储库的一部分,我们如何自动将 git 存储库配置部署到客户端?
非常感谢您的帮助! 亲切的问候,汤姆
非常感谢,@paulsm4,您的回答 - 但这不是解决方案。
经过更多调查,我找到了这个答案:
- .gitattributes 可以放在存储库根目录中(与 .git 目录平行),然后将 .gitattributes 应用于此存储库的所有已处理文件。
- .git属性也可以放在任意子目录下,只作用于该子目录下的文件
- .git/info/attributes 可以使用它一个不想提交到存储库的属性文件
因此,我的问题的答案是:
…\repository\.git\
…\repository\.gitattributes » will we applied to all handled files in the repository
亲切的问候, 汤姆