1GIT-STRIPSPACE(1)                 Git Manual                 GIT-STRIPSPACE(1)
2
3
4

NAME

6       git-stripspace - Remove unnecessary whitespace
7

SYNOPSIS

9       git stripspace [-s | --strip-comments] < input
10
11

DESCRIPTION

13       Clean the input in the manner used by Git for text such as commit
14       messages, notes, tags and branch descriptions.
15
16       With no arguments, this will:
17
18       ·   remove trailing whitespace from all lines
19
20       ·   collapse multiple consecutive empty lines into one empty line
21
22       ·   remove empty lines from the beginning and end of the input
23
24       ·   add a missing \n to the last line if necessary.
25
26       In the case where the input consists entirely of whitespace characters,
27       no output will be produced.
28
29       NOTE: This is intended for cleaning metadata, prefer the
30       --whitespace=fix mode of git-apply(1) for correcting whitespace of
31       patches or files in the repository.
32

OPTIONS

34       -s, --strip-comments
35           Skip and remove all lines starting with comment character (default
36           #).
37
38       -c, --comment-lines
39           Prepend comment character and blank to each line. Lines will
40           automatically be terminated with a newline. On empty lines, only
41           the comment character will be prepended.
42

EXAMPLES

44       Given the following noisy input with $ indicating the end of a line:
45
46           |A brief introduction   $
47           |   $
48           |$
49           |A new paragraph$
50           |# with a commented-out line    $
51           |explaining lots of stuff.$
52           |$
53           |# An old paragraph, also commented-out. $
54           |      $
55           |The end.$
56           |  $
57
58
59       Use git stripspace with no arguments to obtain:
60
61           |A brief introduction$
62           |$
63           |A new paragraph$
64           |# with a commented-out line$
65           |explaining lots of stuff.$
66           |$
67           |# An old paragraph, also commented-out.$
68           |$
69           |The end.$
70
71
72       Use git stripspace --strip-comments to obtain:
73
74           |A brief introduction$
75           |$
76           |A new paragraph$
77           |explaining lots of stuff.$
78           |$
79           |The end.$
80
81

GIT

83       Part of the git(1) suite
84
85
86
87Git 1.8.3.1                       11/19/2018                 GIT-STRIPSPACE(1)
Impressum