git拉取遠端分支到本地(VScode)

2021-10-22 13:08:35 字數 532 閱讀 3124

一、怎麼樣檢視本地分支

1、如果你使用的是vscode可以直接檢視

2、使用git命令檢視本地分支

git branch 

二、檢視遠端分支

1、使用如下git命令檢視所有遠端分支:

git branch -r

2、檢視遠端和本地所有分支:

git branch -a

三、拉取遠端分支建立本地分支

1、使用如下命令:

git checkout -b 本地分支名x origin/遠端分支名x

使用該方式會在本地新建分支x,並自動切換到該本地分支x。

採用此種方法建立的本地分支會和遠端分支建立對映關係。

例如,你想要更新的遠端分支是feature/1.1.0

那麼你的命令就是

git checkout -b feature/1.1.0  origin/feature/1.1.0

git拉取遠端分支到本地

檢視遠端分支 git branch r 檢視本地分支 git branch 拉取遠端分支 git checkout b 本地分支 origin 遠端分支 拉取遠端分支 git pull origin 遠端分支 建立分支 git branch set upstream to origin 遠端分支名 ...

git 拉取遠端分支到本地

步驟 1 新建乙個空檔案,檔名為hhhh 2 初始化 git init3 自己要與origin master建立連線 下劃線為遠端倉庫鏈結 git remote add origin git github.com x nothing2.git4 把遠端分支拉到本地 git fetch origin ...

git 拉取遠端分支到本地新分支

方法1 可以把遠端某各分支remote branch name拉去到本地的branch name下,如果沒有branch name,則會在本地新建branch name git fetch origin remote branch name branch ame 然後切換分支 git checkou...