所以我在 GitHub 存盤庫上創建了一個快速更改,但它需要更多的作業,添加單元測驗并運行構建。因此,我使用 Web 界面創建了新分支:
https://github.com/jcubic/prism/tree/patch-1
但是當我git pull在終端中使用時,我沒有任何改變。當我使用時,git branch -a我有:
$ git branch -a
* master
scheme-operators
remotes/origin/HEAD -> origin/master
remotes/origin/master
remotes/upstream/gh-pages
remotes/upstream/maste
沒有分行patch-1。我在 .git/config 中有這個:
[remote "origin"]
url = [email protected]:jcubic/prism.git
fetch = refs/heads/master:refs/remotes/origin/master
如何使用 GitHub 上的內容更新我的本地存盤庫?
編輯:
可能是 GitHub 端的一個 bug。已經舉報了,我在等回復。
uj5u.com熱心網友回復:
你需要先使用git fetch。
這會從 GitHub 下載所有分支及其提交歷史(請注意,它git pull也運行,git fetch但也 a git merge)。
運行后git fetch,可以看到遠程分支git branch -a。
然后,您可以使用git checkout patch-1或來檢查它git checkout -b patch-1 remotes/origin/patch-1。
uj5u.com熱心網友回復:
您需要先從遠程獲取分支。
- 要從您在本地跟蹤的遠程獲取所有分支,您可以運行
git fetch --all - 要從特定的遠程獲取,在這種情況下為 origin,請運行
git fetch origin - 在這種情況下,要從多個遙控器、原點和上游獲取,請運行
git fetch --multiple origin upstream - 然后查看所有分支運行
git branch -a - 然后結帳分支運行
git checkout nameofnewbranch
'git fetch' 的檔案可以在這里找到。
轉載請註明出處,本文鏈接:https://www.uj5u.com/qiye/332843.html
下一篇:Ubuntugit備份檔案
