看板 Linux 關於我們 聯絡資訊
各位板友午安 github 在 linux 之下也常用,所以我就來這邊請教了 我在 github 上有創另一個 branch xxx, 但我整包拉下來的時候 git clone http://XXXXXXXXXXXXX ,打開資料夾,git branch 它只有 master 這個 branch,請問我要如何連同 master 將另一個 branch 也一起拉下來呢? 謝謝。 -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 61.220.220.235 ※ 文章網址: https://www.ptt.cc/bbs/Linux/M.1429428713.A.E56.html
Bencrie: git checkout -b localbranchname origin/remotebranch 04/19 16:10
dearlove: git pull BRANCHNAME 04/19 16:11
dearlove: 阿錯了 一樓是對的:p 04/19 16:11
gn00618777: 謝謝 04/19 20:48
goldie: 若你希望長出來的 local-branch-name 跟 remote-branch-na 04/19 21:36
goldie: me 一樣,則 1F 的指令可用 "-t" 參數直接簡寫成 git chec 04/19 21:36
goldie: kout -t remote-name/branch-name 04/19 21:36
Qiqi: 其實就checkout branch name就好了,若你本機沒有哪個branch 04/19 23:05
Qiqi: ,就會自動抓遠端的那一份來本機 04/19 23:05
chusiang: 8F ++,在下也都是直接 checkout 就有了! 04/20 08:52
CP64: 沒注意過 -t 這個 switch 聽起來挺好用的 04/20 11:14
lc85301: 你可以用git branch -r 看到遠端branch 04/20 14:44
pcchou: BTW,這應該是 Git 的問題,而跟 GitHub 沒啥關係喔! 04/20 19:33