如下,提交不了,以前可以的: (base) root@autodl-container-ca89479d78-0f9610d0:~/autodl-fs/LLM-Agent# git push origin main This repository is configured for Git LFS but 'git-lfs' was not found on your path. If you no longer wish to use Git LFS, remove this hook by deleting .git/hooks/pre-push. error: failed to push some refs to 'https://github.com/Mrnoneplay/LLM-Agent.git'
方案1:安装 Git LFS(推荐)
bash
# Ubuntu/Debian sudo apt update sudo apt install git-lfs # CentOS/RHEL sudo yum install git-lfs # 或者使用包管理器 curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | sudo bash sudo apt-get install git-lfs # 安装后初始化 git lfs install
方案2:如果不想使用 Git LFS
如果你确定不再需要 Git LFS,可以移除 LFS 配置:
bash
# 移除 LFS hook rm .git/hooks/pre-push # 或者完全移除 LFS 跟踪 git lfs untrack "*" git add .gitattributes git commit -m "remove LFS tracking"
方案3:临时解决方法
如果急需提交,可以暂时绕过 pre-push hook:
bash
git push origin main --no-verify
检查当前 LFS 状态
bash
# 查看哪些文件被 LFS 跟踪 git lfs track # 查看 .gitattributes 文件 cat .gitattributes
推荐做法
-
安装 Git LFS(如果你的仓库中有大文件)
-
然后执行:
bash
git lfs install git add . git commit -m "your message" git push origin main
选择哪种方案取决于你是否需要在仓库中管理大文件。如果仓库中有大文件(如模型文件、数据集等),建议安装 Git LFS;如果没有,可以移除 LFS 配置。
然后可以了:

645

被折叠的 条评论
为什么被折叠?



