[英]On Windows git: “error: Sparse checkout leaves no entry on the working directory”
[英]Git checkout: Asterisk pathspec not working
這工作正常:
git checkout **/pom.xml
但是我們不能對另一個分支運行它
git checkout anotherbranch **/pom.xml
git checkout anotherbranch -- **/pom.xml
error: pathspec '**/pom.xml' did not match any file(s) known to git.
我們使用的是Windows 7 / DOS。
有人知道為什么嗎?
請注意,如果沒有**
,它可以正常工作。 這將從根目錄簽出pom.xml。 但是,我們正在嘗試檢出目錄樹中的所有pom.xml。
我認為這里發生的是:
Per torek :
Shell用當前工作目錄中的所有文件名替換* 1,然后執行該操作,然后運行git
我認為當前的分支/工作目錄中包含與pathspec匹配的文件,這些文件不在 anotherbranch
。 當我們嘗試有效地運行git checkout anotherbranch unknown_file
時,這會導致錯誤。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.