通过git命令 将 本地创建分支提交到远程

19 阅读1分钟

git checkout -b sy/test 创建一个新的分支 sy/test

git add . 将当前修改的文件全部上传

git commit -m 'this is test' 提交到本地的代码仓库 增加提交内容 this is test

git push --set-upstream origin sy/test 提交到远程分支

注意: 创建出来的分支是在当前分支的基础上

分支提交错误 回退操作

git reset --hard HEAD~1

git push origin HEAD --force