git新建远程分支以及其他操作

git新建分支步骤如下(1-6)

// 用到的命令行
// *branchName: 自己定义的分支名称

git checkout -b branchName
git add .
git commit -m "init branchName"
git push origin branch branchName

请添加图片描述

报错解决:

error: src refspec xxx does not match any.
error: failed to push some refs to ‘ssh://git@’

解决方法:git push origin HEAD:branchName

出现无法pull,不能更新问题报错

Can’t Update
No tracked branch configured for branch anhui or the branch doesn’t exist.
To make your branch track a remote branch call, for example,
git branch --set-upstream-to=origin/branchName branchName (show balloon)

解决方法 复制报错最后一句运行:git branch --set-upstream-to=origin/branchName branchName

猜你喜欢

转载自blog.csdn.net/qq_40407998/article/details/125999247
今日推荐