【Git】本地文件夹上传到远程仓库,并新建分支
目录
初始化本地文件
git init
将文件夹中代码添加到本地仓库
git add .
提交文件
git commit -m "提交说明"
建立本地分支
git branch newbranch
切换到新建分支 newbranch
git checkout newbranch
将本地仓库与远程仓库建立联接
git remote add origin 远程仓库地址
将远程仓库内容与本地合并
git pull 远程仓库地址 newbranch --allow-unrelated-histories
将本地分支上传到远程仓库,并新建分支远程newbranch
git push -u origin newbranch