commands.sh

git stripspace

all

Read text (e.g. commit messages, notes, tags, and branch descriptions) from `stdin` and clean it into the manner used by Git.

More info →

Options (2)

-s, --strip-commentsboolean

Trim whitespace and Git comments from a file

Example: cat {{path/to/file}} | git stripspace {{[-s|--strip-comments]}}
-c, --comment-linesboolean

Convert all lines in a file into Git comments

Example: git < {{path/to/file}} stripspace {{[-c|--comment-lines]}}

Examples (3)

Trim whitespace from a file

cat path/to/file | git stripspace

Trim whitespace and Git comments from a file

cat path/to/file | git stripspace [-s|--strip-comments]

Convert all lines in a file into Git comments

git < path/to/file stripspace [-c|--comment-lines]
made by @shridhargupta | data from tldr-pages