2015-04-07 33 views
0

我在一個項目中添加了多個遠程。 如何檢查分支機構上的特定分支和推送代碼。git中的特定遠程列表分支

例如。

origin https://[email protected]/username/repo.git (fetch) 
origin https://[email protected]/username/repo.git (push) 
stash http://[email protected]/scm/omed/repo.git (fetch) 
stash http://[email protected]/scm/omed/repo.git (push) 

這裏添加了兩個遙控器。 目前我只有原始分支不存儲分支。

我想列出特定遠程的所有分支。

當我做git branch -a我只看到從原產

我需要上市下來藏匿遠程分支指令分支。

+1

'GIT中拉藏匿'和'GIT中推藏匿'推。隱藏是不好的遠程名稱雖然... – Vishwanath

+1

@Vishwanath,我如何檢查隱藏的分支? – KKB

+1

'git checkout -b 隱藏/ ' – Vishwanath

回答

2

此步驟如下。

1)獲取遠程信息。存儲在這種情況下是遠程名稱。

git fetch stash 

2)顯示的遠程分支

git branch -a 

3)現在可以創建其通過遠程分支跟蹤像以下本地分支。

git checkout -b <branche-name> stash/<branch-name> 

4)上拉或使用遠程名稱

git pull stash <branch-name> 
git push stash <branch-name>