使用git push推送分支时,遇到错误:
fatal: The current branch master has no upstream branch.
To push the current branch and set the remote as upstream, use
git push --set-upstream origin master
大意就是,当前分支与远程分支未建立联系,按照提示运行将分支进行关联,然后再使用git push
命令
再次复习一下今天使用到的Git指令:
#查看分支
git branch
#切换到已有分支
git checkout 分支名
#切换到还未建立的分支
git checkout -b 新分支名
#显示当前项目状态
git status
#提交项目到本地仓库
git commit -m "备注信息"
#将本地仓库分支推送到远程仓库并建立分支
git push -u origin 分支名
#更新分支(合并分支)
git merge 分支名