qyf404

场景

有时候我们开发需要开一个分支,这样可以有效的并行开发.

开分支有两种方式:

  • 一种是在远程开好分支,本地直接拉下来;
  • 一种是本地开好分支,推送到远程.

远程先开好分支然后拉到本地

git checkout -b feature-branch origin/feature-branch    //检出远程的feature-branch分支到本地

本地先开好分支然后推送到远程

$  git checkout -b feature-branch    //创建并切换到分支feature-branch  
$  git push origin feature-branch:feature-branch    //推送本地的feature-branch(冒号前面的)分支到远程origin的feature-branch(冒号后面的)分支(没有会自动创建)

关于作者

分类:

技术点:

相关文章:

  • 2021-07-24
  • 2021-10-12
  • 2021-11-15
  • 2021-12-01
  • 2022-01-01
  • 2021-11-21
  • 2021-11-21
  • 2021-11-21
猜你喜欢
  • 2021-07-15
  • 2021-11-01
  • 2021-04-17
  • 2021-08-01
  • 2021-04-21
  • 2021-04-17
  • 2021-11-19
相关资源
相似解决方案