简体   繁体   English

更改 .gitattributes 后,文件仍然(不是)在 GIT LFS 中

[英]Files are still (not) in GIT LFS after changing .gitattributes

When using GIT LFS , .gitattributes controls which files are managed by GIT LFS and which ones are not.使用GIT LFS 时.gitattributes控制哪些文件由 GIT LFS 管理,哪些不是。 According to the documentation, all it takes to move files between GIT LFS and regular GIT storage is to change .gitattributes .根据文档,在 GIT LFS 和常规GIT存储之间移动文件所需的只是更改.gitattributes

I have modified .gitattributes in a Bitbucket repository, but git lfs ls-files still lists the same files as before, including files that should no longer be managed by GIT LFS and not including files that should now be managed by GIT LFS.我已经修改了 Bitbucket 存储库中的.gitattributes ,但git lfs ls-files仍然列出了与以前相同的文件,包括不应再由 GIT LFS 管理的文件,也不包括现在应由 GIT LFS 管理的文件。 Also, committing and pushing the change in .gitattributes is suspiciously fast.此外,提交和推动.gitattributes的更改.gitattributes非常快。

Is there a command that I can (or have to) run to update the GIT LFS status of all files and move them to the correct storage?是否有我可以(或必须)运行的命令来更新所有文件的GIT LFS状态并将它们移动到正确的存储?

Well, it seems that git lfs have to be used like git lfs track something.bin , and manually change .gitattributes won't really add exist files to LFS.好吧,似乎git lfs必须像git lfs track something.bin一样使用,并且手动更改.gitattributes不会真正将.gitattributes文件添加到 LFS。

If you manually modify the .gitattributes file, my solution is:如果手动修改.gitattributes文件,我的解决办法是:

After modify the file, run these commands:修改文件后,运行以下命令:

git rm --cached -r .
git add -A

It may take a while if there is a lot of files.如果文件很多,可能需要一段时间。 But it does the trick.但它确实有效。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 更改为.gitattributes后Git重新签出文件 - Git recheckout files after change to .gitattributes Git LFS 还在比较文件吗? - Git LFS still diff-ing files? git ls-files-基于.gitattributes查询文件的未公开语法-git ls-files':(attr:filter = lfs)' - git ls-files - undocumented syntax that queries files based on their .gitattributes - git ls-files ':(attr:filter=lfs)' Git lfs(大型文件存储)表示 lfs 管理的文件在 git lfs 拉取后被修改 - Git lfs (Large File Storage) says lfs managed files are modified after a git lfs pull Git LFS:如何使.gitattributes 捕获多个具有相同名称但在不同文件夹中的无扩展名文件,没有带扩展名的文件 - Git LFS: How to make .gitattributes catch multiple extension-less files with the same name, but in different folders, without files with extension 是否必须在 gitattributes 中使用 Git 大文件存储 (LFS) 的过滤器属性? - Is it mandatory to use the filter attribute for Git Large File Storage (LFS) in gitattributes? 使用 new.gitattributes 文件迁移 Git-LFS - Git-LFS migrate using the new .gitattributes file git-lfs .gitattributes 文件:奇怪的 unicode 字符 - git-lfs .gitattributes file: strange unicode characters `git lfs track` 的作用不仅仅是写入 `.gitattributes` 吗? - Does `git lfs track` do more than writing to `.gitattributes`? Git lfs 正在更新 two.git 属性。 保留哪一个? - Git lfs is updating two .gitattributes. Which one to keep?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM