<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: cso662</title>
    <description>The latest articles on DEV Community by cso662 (@cso662).</description>
    <link>https://dev.to/cso662</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3536166%2F0fd34c6a-9b19-4a89-a5f3-9b14cb712154.png</url>
      <title>DEV Community: cso662</title>
      <link>https://dev.to/cso662</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/cso662"/>
    <language>en</language>
    <item>
      <title>Hugginface 上移动 Datasets 的 git lfs 文件</title>
      <dc:creator>cso662</dc:creator>
      <pubDate>Mon, 29 Sep 2025 03:01:05 +0000</pubDate>
      <link>https://dev.to/cso662/hugginface-shang-yi-dong-datasets-de-git-lfs-wen-jian-39pl</link>
      <guid>https://dev.to/cso662/hugginface-shang-yi-dong-datasets-de-git-lfs-wen-jian-39pl</guid>
      <description>&lt;p&gt;Huggingface 上的数据集一般都比较大，动辄上百 GB，在上传的时候我经常也是直接用 HF 的 CLI 工具中的 upload-large-folder 工具而不是用 git。&lt;/p&gt;

&lt;p&gt;git 本身用来管理小文件比较合适，大文件用 git lfs 来 track 也合适但是最好不要用 git push 来上传 git lfs 的实际文件，他没有现代上传工具的很多特性，网络不好或者中断的时候，几百 G 的文件会想死&lt;/p&gt;

&lt;p&gt;但这又引申了另一个问题，如果本地的文件都是通过 hf cli 的 upload 或者 upload-large-folder 传上去的，那如果要对远端的 datasets 仓库做修改该怎么做比较好，重新下载几百 G 的数据到本地显然不现实，这里就是体现 git 优雅特性的地方了，不需要把 git lfs track 的所有文件都下载下来就可以使用元数据进行操作，大致如下&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;GIT_LFS_SKIP_SMUDGE=1 git clone git@hf.co:datasets/username/reponame

cd reponame

mkdir target-folder

git mv folder1 target-folder/folder

git commit -m "move things around"

git push
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;这样就可以在不下载 git lfs 中的任何数据的情况下，更改远端数据的元信息，进行文件整理了&lt;/p&gt;

</description>
      <category>git</category>
      <category>huggingface</category>
      <category>gitlfs</category>
    </item>
  </channel>
</rss>
