git lfs的使用

* git lfs env:
    Display the Git LFS environment.
* git lfs checkout:
    Populate working copy with real content from Git LFS files
* git lfs clone:
    Efficiently clone a Git LFS-enabled repository
* git lfs fetch:
    Download git LFS files from a remote
* git lfs fsck:
    Check GIT LFS files for consistency.
* git lfs install:
    Install Git LFS configuration.
* git lfs logs:
    Show errors from the git-lfs command.
* git lfs ls-files:
    Show information about Git LFS files in the index and working tree.
* git lfs pull:
    Fetch LFS changes from the remote & checkout any required working tree files
* git lfs push:
    Push queued large files to the Git LFS endpoint.
* git lfs status:
    Show the status of Git LFS files in the working tree.
* git lfs track:
    View or add Git LFS paths to Git attributes.
* git lfs untrack:
    Remove Git LFS paths from Git Attributes.
* git lfs update:
    Update Git hooks for the current Git repository.
* git lfs version:
    Report the version number.

Low level commands 
-------------------

* git lfs clean:
    Git clean filter that converts large files to pointers.
* git lfs pointer:
    Build and compare pointers.
* git lfs pre-push:
    Git pre-push hook implementation.
* git lfs smudge:
    Git smudge filter that converts pointer in blobs to the actual content.
  • 全局打开支持 git lfs
git lfs install
  • repo里面开始跟踪
cd $yourrepo
git lfs track "*.zip"

git add *.zip
git commit -m "something "
git push -u origin --all

这里写图片描述

  • *
使用Git LFS(Large File Storage)可以更好地管理大文件,以避免将它们包含在Git仓库中导致仓库过大的问题。下面是使用Git LFS的一些基本步骤: 1. 安装Git LFS:首先,您需要在您的计算机上安装Git LFS。您可以从Git LFS的官方网站(https://git-lfs.github.com/)下载适用于您操作系统的安装程序,并按照安装指南进行安装。 2. 配置Git LFS:安装完成后,您需要告诉Git LFS要跟踪和管理哪些大文件。在您的Git仓库目录中,运行以下命令配置Git LFS: ``` git lfs install ``` 3. 跟踪大文件:要跟踪某个大文件,您可以使用以下命令: ``` git lfs track <path_to_large_file> ``` 这将在.gitattributes文件中添加一个规则,指定要使用Git LFS来处理指定路径下的大文件。 4. 提交和推送:一旦您完成了对大文件的跟踪,您可以像正常提交和推送其他文件一样提交和推送您的更改。Git LFS会自动将大文件上传到Git LFS服务器,并在提交时替换为Git LFS的指针。 5. 克隆仓库和获取LFS对象:当您克隆带有Git LFS的仓库时,您需要获取LFS对象,即实际存储在仓库之外的大文件。在克隆后的仓库目录中,运行以下命令获取LFS对象: ``` git lfs fetch ``` 6. 检出文件:一旦您获取了LFS对象,您可以使用以下命令将文件检出到您的工作目录: ``` git lfs checkout ``` 这将从Git LFS服务器下载大文件并将其放置在正确的位置。 请注意,如果您只想下载特定的大文件而不是克隆整个仓库,可以使用`git lfs pull`命令,后跟特定的文件路径: ``` git lfs pull --include "<path_to_large_file>" ``` 这样,您就可以使用Git LFS来管理和下载大文件了。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值