Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
git rm $(git ls-files -z -d)必要ではなく、機能しません。他のスイッチのようにファイル名だけでなく、他のガベージを出力に追加するgit rm $(git ls-files -z -u)ためだと思います。-u別の方法はありますか?gitステータスの「マージされていないパス」セクション(したがって、これらはそのセクションの唯一のものです)で「追加された」としてgitリストにあるすべてのファイルを削除したいだけです-u。
git rm $(git ls-files -z -d)
git rm $(git ls-files -z -u)
-u
出力をパイプするcutかsed、コマンドの出力の特定の部分を取得することができます。それ以外の場合、git はスクリプトに適した構文で出力を形成する--raworオプションも提供します。--porcelain
cut
sed
--raw
--porcelain