赞
踩
在仓库目录中运行:
git lfs install
再运行:
git init
git lfs track "*.zip"
git add .
git commit -m "Add large files"
git config --global user.name "Your Name"
git config --global user.email you@example.com
git config --global user.name "seamoon224"
git config --global user.email 1375144937@qq.com
git remote add origin <your-repository-URL>
git push -u origin master
推送失败后再次推送,成功运行了。(好怪)
其实最终还是失败了,因为git LFS空间不足,提示信息:
batch response: This repository is over its data quota. Account responsible for LFS bandwidth should purchase more data packs to restore access.
只能在github上购买1 pack,进入settings,查看plans and usage,拉到最下面,可以看到git LFS data:
可以点击add pack进行购买,然后重新上传。成功!
本地master分支重命名为main,因为github上的分支为main,否则github将会出现两个分支。
# 重命名本地分支
git branch -m master main
# 推送 main 分支到远程仓库,并设置跟踪信息
git push -u origin main
# 删除远程的 master 分支
git push origin --delete master
合并远程main和master分支:
# 首先切换到 main 分支
git checkout main
# 拉取最新的 main 分支
git pull origin main
# 合并 master 到 main
git merge master
# 如果一切正常,推送更新后的 main 分支
git push origin main
# 如果您决定使用 main,现在可以删除本地和远程的 master 分支
git branch -d master # 删除本地的 master
git push origin --delete master # 删除远程的 master
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。