【Git】切换到远程分支

Git切换到远程分支:git checkout -b origin/分支名称

git checkout -b origin/dev_litianchao
 ┃   ┃        ┃  ┗━ origin/dev_litianchao :远程分支/dev_litianchao分支
 ┃   ┃        ┃      ┃      ┗━ dev_litianchao : 想要拉的分支
 ┃   ┃        ┃      ┗━ origin : 远程分支,所有的远程分支都要带上origin
 ┃   ┃        ┗━ -b : -b 的意思是 base(基础),以当前分支为 base (基础)
 ┃   ┃        	  ┗━ -b : 带上直接切换到这个分支,不带会报错
 ┃   ┗━ checkout : 切换分支
 ┗━ git : 所有的git指令的前边都要带上git

checkout 不带 -b 报错:

$ git checkout origin/dev_litianchao
Note: switching to 'origin/dev_litianchao'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:

  git switch -c <new-branch-name>

Or undo this operation with:

  git switch -

Turn off this advice by setting config variable advice.detachedHead to false

HEAD is now at 6641ae75d snmp修复Firmware state状态数值

Git拉取远程分支到本地 git pull origin 3.0.2.36

git pull origin 3.0.2.36
 ┃   ┃    ┃      ┗━ 3.0.2.36 : 远程的分支
 ┃   ┃    ┗━ origin : 远程
 ┃   ┗━ pull : 拉取分支
 ┗━ 

你可能感兴趣的:(git,github)