如何在git中跟踪.lnk文件? [英] How to track .lnk files in git?

查看:149
本文介绍了如何在git中跟踪.lnk文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的git仓库中有 .lnk 文件.成功克隆存储库后,其他用户便可以使用它们.

I have .lnk files in my git repo. And other users are able to use them after cloning the repo successfully.

但是,一旦使用了它(例如单击它),它就会自动在git中进行修改.有办法避免这种情况吗?

However, once you have used it (clicked on it for example), it automatically becomes modified in git. Is there a way to avoid this?

通常,在git中跟踪.lnk文件的最佳做法是什么?还是有更好的选择?

In general, what is your best practice for tracking .lnk files in git? Or is there a better alternative?

推荐答案

您可以通过以下方式指向git以假定此lnk文件未更改:

You can point git to assume that this lnk file is unchanged by:

git update-index --assume-unchanged <lnk-file>

您可以通过以下方式撤消该操作:

You can undo that by:

git update-index --no-assume-unchanged <lnk-file>


我认为您应该避免将lnk文件上传到git,因为它们很容易生成.因此,您应该制作一个批处理脚本来生成它们,并在下载代码后指向文档中的任何人以运行该脚本.


I think you should avoid upload lnk files to git because they are easily generated. so you should make a batch script for generating them and point anyone in documentation to run that script after downloading code.

这篇关于如何在git中跟踪.lnk文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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