簡體中文 ▾
主題 ▾
最新版本 ▾ git-stripspace 最後更新於 2.50.0
git-stripspace 手冊的更改
設定和配置
獲取和建立專案
基本快照
分支與合併
共享和更新專案
檢查和比較
打補丁
除錯
電子郵件
外部系統
伺服器管理
指南
管理
底層命令
- 2.50.1 無更改
-
2.50.0
2025-06-16
- 2.43.1 → 2.49.1 無更改
-
2.43.0
2023-11-20
- 2.7.6 → 2.42.4 無更改
-
2.6.7
2017-05-05
- 2.5.6 無更改
-
2.4.12
2017-05-05
-
2.3.10
2015-09-28
- 2.1.4 → 2.2.3 無更改
-
2.0.5
2014-12-17
描述
從標準輸入讀取文字,例如提交訊息、備註、標籤和分支描述,並以 Git 使用的方式進行清理。
不帶任何引數時,這將會
-
移除所有行末尾的空白字元
-
將多個連續的空行合併為一個空行
-
移除輸入開頭和末尾的空行
-
如果需要,在最後一行新增一個缺失的 \n。
如果輸入完全由空白字元組成,則不會產生任何輸出。
注意:這旨在清理元資料。對於更正倉庫中補丁或檔案的空白字元,請優先使用 git-apply[1] 的 --whitespace=fix
模式。
示例
給定以下帶噪聲的輸入,其中 $ 表示行尾
|A brief introduction $ | $ |$ |A new paragraph$ |# with a commented-out line $ |explaining lots of stuff.$ |$ |# An old paragraph, also commented-out. $ | $ |The end.$ | $
使用不帶引數的 git stripspace 以獲得
|A brief introduction$ |$ |A new paragraph$ |# with a commented-out line$ |explaining lots of stuff.$ |$ |# An old paragraph, also commented-out.$ |$ |The end.$
使用 git stripspace --strip-comments 以獲得
|A brief introduction$ |$ |A new paragraph$ |explaining lots of stuff.$ |$ |The end.$