2013-10-21 53 views
0

-u選項與拉做什麼?「git pull remotename -u remotebranchname」是做什麼的?

我現在的分支是主人。

它從遠程分支拉到我當前的分支(主)?

是這個命令從指定的「遠程分支」拉到我當前的(主)分支?
運行這個git命令有什麼影響?

實際上,我使用了一組命令,並最終污染了我的功能分支,所以試圖跟蹤哪個命令做到了。

是否執行此命令從指定的遠程分支獲取更改到我當前的分支(主)?

+1

您能否突出顯示文檔中的哪些內容(https://www.kernel.org/pub/software/scm/git/docs/git-pull.html)不清楚? –

+0

@BenjaminBannier - 在手冊頁我dint得到什麼解釋爲-u.now我有點想法it.thankyou – LearningC

回答

1

對於正常使用git的,這個選項不起作用。

該文檔說明它是--update-head-ok選項的縮寫。此選項用於允許獲取更改當前所在的分支。所以如果你的分支是主人,這個選項允許取回改變refs/heads/master

當你正常使用git時,你將不會這麼做。提取只會更改refs/remotes/origin/master。隨後的合併更新refs/heads/master-u選項不會更改合併的工作方式。

鑑於此選項的作用是禁用健全性檢查,您不應該使用它,除非您真的知道自己在做什麼。

+0

好吧thankyou.now我有想法。 – LearningC

0

從手冊頁git pull

-u, --update-head-ok 
      By default git-fetch refuses to update the head which corresponds to the current branch. This flag disables the check. This is purely for the internal 
      use for git-pull to communicate with git-fetch, and unless you are implementing your own Porcelain you are not supposed to use it. 
相關問題