git 大文件管理 *** 作方法

git 大文件管理 *** 作方法,第1张

Lets take a look at the workflow when you need to check large files into your Git repository with Git LFS. For example, if you want to upload a very large file and check it into your Git repository:

Once a certain file extension is marked for tracking as a LFS object you can use Git as usual without having to redo the command to track a file with the same extension:

Make sure that .gitattributes is tracked by Git. Otherwise Git LFS will not be working properly for people cloning the project:

Cloning the repository works the same as before. Git automatically detects the LFS-tracked files and clones them via HTTP. If you performed the git clone command with a SSH URL, you have to enter your GitLab credentials for HTTP authentication.

If you already cloned the repository and you want to get the latest LFS object that are on the remote repository, eg. for a branch from origin:

https://docs.gitlab.com/ee/administration/lfs/manage_large_binaries_with_git_lfs.html#using-git-lfs

当本地仓库积攒轿宏了比较旅余多版本的LFS导致体积较大的时候,可以通过以下命令进拆帆滚行清理:

git lfs prune

私有lfs仓库设置 .lfsconfig 配置文件,需要一并提交到 Git,否则Clone的时候不会去配置的地址上找

git config -f .lfsconfig lfs.url http://10.208.10.14:8080/repository/test01/

cat .lfsconfig

[lfs]

url = http://10.208.10.14:8080/repository/test01/

gitlab默认上传文件最大10M,如果大于10M,则需要做如键悉下修改:

vim app/models/note.rb

找到如下行:validates :attachment, file_size: { maximum: 10.megabytes.to_i }

将10改为你想要的大小;

如果httpserver使用提nginx,则修改配置文皮亮纤件nginx.conf,在燃仿http中加入 client_max_body_size 50m, 这个值默认是1M。

此外,如果用eclipse的插件上传,报如下错:

Can't connect to any repository: http://10.210.92.69/bcop/bcop_si.git (An internal Exception occurred during push: http://10.210.92.69/bcop/bcop_si.git: 411 Length Required)

做如下修改:

Eclipse>Preferences>Team>Git>Configuration>Add Entry

Enter http.postBuffer as key and 524288000 as value (if 500M is enough)

您想问掘态丛的是gitlab怎么查看文件大小吗?列表页面上。

你可以在GitLab的文件列表页面上查看文件大小,打开文件闭脊列表页面判樱,将鼠标悬停在文件上,会出现一个信息框,即可查找。

GitLab是一个用于仓库管理系统的开源项目,使用Git作为代码管理工具,并在此基础上搭建起来的web服务。


欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/tougao/12282837.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-05-24
下一篇 2023-05-24

发表评论

登录后才能评论

评论列表(0条)

保存