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

2021-09-27 07:41:11 字數 349 閱讀 4220

方法1:

# 可以把遠端某各分支remote_branch_name拉去到本地的branch_name下,如果沒有branch_name,則會在本地新建branch_name

git fetch origin remote_branch_name:branch_ame

# 然後切換分支

git checkout branch_name

方法2:

# 獲取遠端分支到本地,並切換分支

git checkout -b branch_name remotes/origin/remote_branch_name

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拉取遠端指定分支到本地

以前寫自己模組的時候,曾經建了乙個本地分支dev,然後這個分支很久沒有使用了,最近又要使用這個分支dev,然後要將遠端倉庫master分支上的內容同步到我本地dev分支 切換分支到本地分支 git checkout dev 拉取更新遠端主倉庫資料 git pull origin master 本地倉...