简体中文 ▾
Localized versions of git-stripspace manual
Topics ▾
Email
Latest version
▾
git-stripspace last updated in 2.43.0
Changes in the git-stripspace manual
Setup and Config
Getting and Creating Projects
Basic Snapshotting
Branching and Merging
Sharing and Updating Projects
Inspection and Comparison
Patching
Debugging
External Systems
Server Admin
Guides
- gitattributes
- Command-line interface conventions
- Everyday Git
- Frequently Asked Questions (FAQ)
- Glossary
- Hooks
- gitignore
- gitmodules
- Revisions
- Submodules
- Tutorial
- Workflows
- All guides...
Administration
Plumbing Commands
描述
从标准输入中读取文本,如提交信息、注释、标签和分支描述,并按照 Git 使用的方式进行清理。
如果没有任何参数,就会这样:
-
删除所有行的尾部空白
-
将多个连续空行折叠为一个空行
-
删除输入内容开头和结尾的空行
-
如有必要,在最后一行添加一个缺失的 \n。
如果输入完全由空白字符组成,则不会产生任何输出。
NOTE: This is intended for cleaning metadata. Prefer the --whitespace=fix
mode of git-apply[1] for correcting whitespace of patches or files in
the repository.
实例
给定以下噪音输入,$ 表示一行的结束:
|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.$
GIT
属于 git[1] 文档