00 基本步骤
//初始化git
git init
//查看现有的远程仓库
git remote -v
//如果目标仓库不存在,添加一个新的远程仓库
git remote add <name> <url>
//设置远程仓库url
git remote set-url <name> <url>
//添加到缓存区
git add.
//提交信息
git commit -m "Your commit message here"
//推送更改
git push origin <branch-name>
//如果想所有分支一起推
git push --all
01 error: src refspec does not match any
排查顺序与解决方案
- 检查本地分支
git branch
- 如果分支不存在,创建并切换到该分支
git checkout -b <branch-name>
- 关联本地分支和远程仓库
git push -u <name> <branch-name>