我試圖從遠程標記創建分支,但似乎無法執行此操作。當我嘗試如何從遠程標記執行「git checkout -b <branchname>」
git checkout -b test origin/deploy
哪裏起源是遠程和部署是我要檢查出的標籤,但我得到
fatal: git checkout: updating paths is incompatible with switching branches.
Did you intend to checkout 'origin/deploy' which can not be resolved as commit?
UPDATE: 我剛剛發現
git fetch --all -t
對我來說工作不正常。當它下載所有分支時,它並不下載所有標籤,所以當我檢出部署時,它是舊標籤。現在我執行
git fetch --all && git fetch -t
這樣,當我創建一個基於標籤
git checkout -b test deploy
新的分支是最新的,與上次部署一個新的分支。
這不適用於我(MacOs X,遠程託管在github上)我得到:致命:無法更新路徑並切換到分支'6.2.3-ga4'時間 –
確保你試圖跟蹤的分支存在,也就是先做一個git fetch,或者git pull,或者git remote update等等。 –