我有一個git分支的問題,我試圖切換到不同的分支,其中有一些更改的文件和更改的目錄,但我無法在我的本地存儲庫中看到這些更改。Git結帳不下載分支新文件
在主我有:
dir1/files
dir2/files
在分支我有
new_dir1/files
dir2/files
dir3/files
當命令git fetch && git checkout myBranch
我可以在終端
Checking out files: 100% (31012/31012), done.
Switched to branch 'featured_phase3'
Your branch is up-to-date with 'origin/myBranch'.
看到但DIR1是沒有重新命名爲new_dir1,並且沒有下載dir3。
沒錯,我失去了一些東西,因爲我是新來的git
任何幫助將欣賞
Thxs
這裏有一種術語濫用,因爲'git checkout'不會「下載」*任何*。 'git fetch'命令可以,但'git fetch'也(非常故意地)不會影響你的任何分支,並且'git checkout'通常檢查你的一個分支。因此,「下載,影響我的分支並檢查它們」的完整過程需要使用'git fetch',然後再加上* just *'git checkout'以外的其他命令。 (有一些例外,因爲'git checkout'可以做其他事情,但我正在從你的例子開始工作。) – torek