‘’‘
remote: error: See https://gh.io/lfs for more information.
remote: error: File checkpoints/sam2.1_hiera_large.pt is 856.48 MB; this exceeds GitHub's file size limit of 100.00 MB
remote: error: GH001: Large files detected. You may want to try Git Large File Storage - https://git-lfs.github.com.
error: failed to push some refs to 'github.com:luoolu/FalconCoreLabeling.git'
To github.com:luoolu/FalconCoreLabeling.git
! refs/heads/master:refs/heads/master [remote rejected] (pre-receive hook declined)
Done
’‘’
The error
remote: error: File checkpoints/sam2.1_hiera_large.pt is 856.48 MB; this exceeds GitHub's file size limit of 100.00 MB
means GitHub will refuse to store any file over 100 MB in a normal git push. You have two main options:
Git Large File Storage (LFS) replaces large files with lightweight pointers in your repository, and stores the real content on a separate LFS server.
-
Install Git LFS On Ubuntu/Debian:
sudo apt-get update sudo apt-get install git-lfs
Or follow instructions at https://git-lfs.github.com.
-
Initialize LFS in your repo
cd /path/to/anylabeling git lfs install -
Tell Git LFS to track your checkpoint files
git lfs track "checkpoints/*.pt"This adds a
.gitattributesfile to your repo. -
Commit the LFS configuration
git add .gitattributes git commit -m "Configure Git LFS for .pt model files" -
Re-add your large file so it’s stored via LFS If you’ve already committed it locally, you need to re-stage it through LFS:
# Remove it from the index (but keep the file on disk) git rm --cached checkpoints/sam2.1_hiera_large.pt # Re-add it (will now be added as an LFS pointer) git add checkpoints/sam2.1_hiera_large.pt git commit -m "Add sam2.1_hiera_large.pt via LFS"
-
Push to GitHub
git push origin master
Now your checkpoint will live in LFS and your push will succeed.
If you prefer not to use Git LFS, you can:
-
Remove the file from your repo
git rm --cached checkpoints/sam2.1_hiera_large.pt git commit -m "Remove oversized checkpoint" git push origin master -
Upload the
.ptfile to a release or external storage (e.g. GitHub Releases, AWS S3, Google Drive). -
In your README, provide a download link:
## Download SAM2 checkpoint ```bash wget https://my-storage.example.com/sam2.1_hiera_large.pt -P checkpoints/
- Git LFS keeps everything in one repo (recommended if you’ll frequently update large weights).
- External hosting is simpler if this is a one-off large file.
Let me know if you’d like any more help setting up Git LFS or hosting the file externally!
''' (.venv) (base) luolu@loobuntu:~/PycharmProjects/anylabeling$ git push -u origin master Username for 'https://github.com': luoolu Password for 'https://luoolu@github.com': remote: Support for password authentication was removed on August 13, 2021. remote: Please see https://docs.github.com/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication. fatal: Authentication failed for 'https://github.com/luoolu/FalconCoreLabeling.git/' ''' 出现这个错误是因为 GitHub 已经不再支持通过账号密码进行 HTTPS 推送认证,需要使用 Personal Access Token(PAT) 或 SSH Key 来替代密码认证。下面分别给出两种方案的完整步骤,你可以任选其一。
-
在 GitHub 上创建 PAT
- 登录到 GitHub 网站,点击右上角头像 → Settings → 左侧栏 Developer settings → Personal access tokens → Tokens (classic) → Generate new token。
- 选择 repo 相关权限(至少要有
repo全选),然后点击 Generate token。 - 复制好生成的 token(注意:这个 token 只会显示一次,请妥善保存)。
-
在本地使用 PAT 进行推送 在终端执行推送命令时,输入用户名和 token 即可把 token 当成「密码」使用:
git push -u origin master # Username: luoolu # Password: <粘贴你的 PAT>
或者,你可以将 remote URL 临时改为在 URL 中直接包含 token(不推荐写死在脚本里,仅作临时演示):
git remote set-url origin https://luoolu:<YOUR_TOKEN>@github.com/luoolu/FalconCoreLabeling.git git push -u origin master
-
(可选)配置凭据管理器 安装并启用 Git 的 credential helper,之后第一次输入 token 后会被缓存,下次就不用再输:
# 以 Linux 为例,安装并启用 git config --global credential.helper store # 推送一次时输入用户名 + token,后续就会自动读取 ~/.git-credentials
-
生成 SSH Key(如果本地还没有的话)
ssh-keygen -t ed25519 -C "luoolu@your_email.com" # 一路回车(使用默认路径),可选设置 passphrase
-
把公钥复制到 GitHub
# 查看公钥内容 cat ~/.ssh/id_ed25519.pub
然后登录 GitHub → 头像 → Settings → 左侧 SSH and GPG keys → New SSH key,粘贴公钥内容并保存。
-
将远程地址改为 SSH 地址
# 查看当前 remote git remote -v # 修改 origin 为 SSH 形式 git remote set-url origin git@github.com:luoolu/FalconCoreLabeling.git
-
测试并推送
# 测试 SSH 连接 ssh -T git@github.com # 推送 git push -u origin master
完成以上任一方案后,再次执行:
git push -u origin master就可以成功将你本地的新功能推送到自己的 GitHub 仓库了。之后也可以照常:
# 同步上游更新
git fetch upstream
git merge upstream/master # 或 git rebase upstream/master
git push origin master祝你推送顺利!
It isn’t a GitHub permissions problem at all but a mis‐configured proxy. The “CONNECT tunnel failed, response 404” is coming from your proxy URL (http://127.0.0.1:33331/commands/pac), not GitHub. Git doesn’t understand PAC files (that “/commands/pac” path) as a proxy endpoint, so every HTTPS CONNECT to github.com is getting a 404 from your local proxy server.
git config --global --unset http.proxy
git config --global --unset https.proxyIf your corporate or local proxy is really at 127.0.0.1 port 33331, point Git at it directly (no PAC file):
git config --global http.proxy http://127.0.0.1:33331
git config --global https.proxy http://127.0.0.1:33331Then retry:
git push -u origin mainGit won’t parse it for you. You have two choices:
- Extract the actual proxy host:port from the PAC file and configure it as above.
- Use a wrapper like
proxychainsortsockswhich does support PAC.proxychains git push -u origin main
If your network lets SSH through (or you can tunnel it), switch your remote to SSH and push over port 22:
- Generate and add an SSH key to GitHub if you haven’t already:
ssh-keygen -t ed25519 -C "your.email@example.com" # then copy ~/.ssh/id_ed25519.pub into your GitHub “SSH and GPG keys” settings
- Change your remote:
git remote set-url origin git@github.com:luoolu/ParseCZI.git
- Push:
git push -u origin main
Finally, make sure the repo name on GitHub really is ParseCZI (no underscore) or Parse_CZI (with underscore). Whichever it is, your remote must exactly match:
git remote -v
# origin https://github.com/luoolu/ParseCZI.git (fetch)
# origin https://github.com/luoolu/ParseCZI.git (push)Once your proxy is set correctly (or removed) and the URL is right, git push will go through.