1. Github从本地上传项目(SSH)
git init
git add .
git commit -m "first commit"
git log
设置SSH本地与Github(在本地的.ssh的目录下)
ssh-keygen -t rsa "xxxx@xxx.com"
生成ssh秘钥,并将秘钥复制到 Github上
再使用ssh,从本地上传项目
git remote set-url origin xxxx.git
xxxx.git 为 SSH连接
最后推送项目
git push -u origin main
2. Github上传大型文件 (git lfs)
2.1 设置LFS要管理的文件类型
git lfs track "**/*.bin"
2.2 添加和提交文件
# 添加 .gitattributes 文件到 Git 暂存区
git add .gitattributes
# 提交 .gitattributes 文件
git commit -m "Add Git LFS tracking for all files in specific folders"
2.3 提交文件
git add .
2.4 连接远程仓库
git commit -m "Add all files to Git LFS"
# 推送到远程仓库
git push origin main