git推送本地分支到远程分支_thomasyuang的博客-CSDN博客_git push本地分支到远程分支

本地新分支推送
剪辑自: https://blog.csdn.net/thomasyuang/article/details/89068698
应用场景
有时候我们开发需要开一个分支,这样可以有效的并行开发.
开分支有两种方式:
一种是在远程开好分支,本地直接拉下来;
一种是本地开好分支,推送到远程.
1、远程先开好分支然后拉到本地
git checkout -b feature-branch origin/feature-branch    //检出远程的feature-branch分支到本地
2、本地先开好分支然后推送到远程
$  git checkout -b newbranch    //创建并切换到分支newbranch 
$  git push origin newbranch:newbranch    //推送本地的newbranch(冒号前面的)分支到远程origin的newbranch(冒号后面的)分支(没有会自动创建)

 

posted @ 2020-10-16 20:37  游泳的花生人-ATC  阅读(1369)  评论(0编辑  收藏  举报