git獲取遠端分支

2021-06-18 00:42:49 字數 274 閱讀 9798

1、git fetch 將遠端分支資訊同步到本地

2、git branch -a 檢視分支資訊

3、git checkout -b branch_name origin/branch_name 或者 git  checkout -t origin/branch_name。使用-t引數預設在本地建立乙個和遠端分支名字一樣的分支

不能用git branch newbranch_name && git pull origin/branch_name,這樣建立的分支是基於本地執行命令時所在的分支

git 獲取遠端分支

另一哥們將分支push到庫中,我怎麼獲取到他的分支資訊呢?如果安裝了git客戶端,直接選擇fetch一下,就可以獲取到了。如果用命令列,執行 git fetch,可以將遠端分支資訊獲取到本地,再執行 git checkout b local branchname origin remote bran...

git本地獲取遠端分支

git branch 檢視本地分支 git branch a 檢視所有分支列表,包括本地和遠端,當前分支的前面用 標記,遠端分支一般會用紅色字型標記出來,帶有remotes origin 分支名 git checkout b 新分支名 git checkout master 切換到master分支 ...

git 遠端分支

git clone缺省會把遠端倉庫整個給clone下來 但只會在本地預設建立乙個master分支 如果遠端還有其他的分支,此時用git branch a檢視所有分支 master remotes origin head origin master remotes origin master remo...