【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
posted @ 2021-12-18 08:04  攀登高山  阅读(215)  评论(0编辑  收藏  举报