<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Git on Qingchen Yu</title><link>https://zhgyqc.site/tags/git/</link><description>Recent content in Git on Qingchen Yu</description><generator>Hugo</generator><language>en</language><lastBuildDate>Sun, 01 Nov 2026 21:35:04 +0800</lastBuildDate><atom:link href="https://zhgyqc.site/tags/git/index.xml" rel="self" type="application/rss+xml"/><item><title>修改 Git Commit 消息指南</title><link>https://zhgyqc.site/blogs/2024-10-22-modify-git-commit-messages/</link><pubDate>Tue, 22 Oct 2024 00:00:00 +0000</pubDate><guid>https://zhgyqc.site/blogs/2024-10-22-modify-git-commit-messages/</guid><description>本文由 ChatGPT 辅助生成
有时候，我们会在提交代码时拼写错误 commit 消息，或者消息描述不够准确。幸运的是，Git 提供了方法来修改已经提交的历史记录，包括 commit 消息。本文将详细介绍如何修改任意数量的 commit 消息，并将它们推送到远程仓库。
修改历史 Commit 消息 如果你想修改之前的 commit 消息，你可以按照以下步骤进行：
运行以下命令来开始交互式修改：git rebase -i HEAD~n。这里的 n 表示你想要修改的最近提交次数。例如，如果你想修改过去五次的提交，可以使用 git rebase -i HEAD~5。这会启动一个交互式编辑器，显示最近几次提交的列表： pick &amp;lt;commit-hash-1&amp;gt; commit message 1 pick &amp;lt;commit-hash-2&amp;gt; commit message 2 pick &amp;lt;commit-hash-3&amp;gt; commit message 3 将你想要修改的 commit 前的 pick 改为 reword，像这样： reword &amp;lt;commit-hash-1&amp;gt; commit message 1 reword &amp;lt;commit-hash-2&amp;gt; commit message 2 reword &amp;lt;commit-hash-3&amp;gt; commit message 3 保存并退出编辑器。之后，Git 会依次打开每个需要修改的 commit 消息的编辑器，你可以在其中修改消息。修改完成后，保存并退出。 完成所有修改后，你会看到如下提示： Successfully rebased and updated refs/heads/main.</description></item><item><title>上传大模型到huggingface的方法（不用梯子）</title><link>https://zhgyqc.site/blogs/2024-08-09-upload-large-model-to-huggingface-without-vpn/</link><pubDate>Fri, 09 Aug 2024 00:00:00 +0000</pubDate><guid>https://zhgyqc.site/blogs/2024-08-09-upload-large-model-to-huggingface-without-vpn/</guid><description>相关配置 下载LFS # 更新包管理器 sudo apt-get update sudo apt-get upgrade # 安装Git（如有则忽略） sudo apt-get install git # 安装Git LFS sudo apt-get install git-lfs # 初始化Git LFS git lfs install # 验证Git LFS是否安装成功 git lfs --version 配置huggingface 从huggingface申请token （需要同时有读写权限的，注意token只会展示一次，所以要记得保存）； 安装huggingface-cli pip install huggingface_hub huggingface-cli login # 输入上边生成的token 下载模型 注：预先要在huggingface上创建好对应的模型仓库
git lfs install # 不需要梯子 git clone https://hf-mirror.com/username/model_name # 需要梯子 git clone https://huggingface.co/username/model_name # 进入仓库并将需要上传的文件放到这个文件夹内 cd model_name 上传模型 追踪大文件 # 追踪需要上传的大文件，后缀需要修改为你需要上传的大文件所对应的 git lfs track &amp;#34;*.</description></item></channel></rss>