0
如何限制的輸出:限制git add。 -a -n呈現目錄(無子目錄)
git add . -A -n
只有本目錄?例如。像這樣:
git add . -A -n --depth=0
我目前在我的項目的基本目錄,並希望看到只在該級別更改的文件。使用grep -v
作爲後處理的一部分,輸出是不實際的,因爲git add . -A -n
也需要太長時間才能掃描子目錄。
如何限制的輸出:限制git add。 -a -n呈現目錄(無子目錄)
git add . -A -n
只有本目錄?例如。像這樣:
git add . -A -n --depth=0
我目前在我的項目的基本目錄,並希望看到只在該級別更改的文件。使用grep -v
作爲後處理的一部分,輸出是不實際的,因爲git add . -A -n
也需要太長時間才能掃描子目錄。
ls -p|grep -v/|xargs git add -An
find . -maxdepth 1 \(-type f -o -type l \) -exec git add {} -A -n \;
'LS -p | grep的-v /'基本上是爲'找相同。 -maxdepth 1 -type f'除了它更短。也許緩慢的部分是點,這是一個目錄,因此導致git遞歸到子目錄中。事實上,下面的xargs版本甚至應該更快,因爲不需要爲每個文件調用git,而是給出一個git調用盡可能多的文件參數。 – PSkocik 2014-09-10 18:06:55