我有一個repo,其中node_modules內的文件也被提交到repo。我需要在repo上執行git diff,但想忽略node_modules下的所有內容。我怎樣才能做到這一點?git diff忽略目錄下的所有內容(node_modules)
我想這git diff old_api..master -- . ':!node_modules'
(如建議在這個答案:https://stackoverflow.com/a/29374503),但它仍然DIFFS裏面的內容node_modules目錄,例如:
diff --git a/db/node_modules/bhttp/README.md b/db/node_modules/bhttp/README.md
也是我不知道什麼..
這樣做我刪除它,並試圖這個:git diff old_api master -- . ':!node_modules'
但沒有區別。
有幫助嗎?
這些文件已經被提交。 –
沒關係,如果你清除緩存並創建一個正確寫入.gitignore文件的東西將理清。我的意思是他們將從存儲庫中刪除 – BatsAuto