简体中文 ▾
主题 ▾
最新版本 ▾ 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.$