Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/git/blob/master/Documentation/git-stripspace.adoc # git [Ported from github.com/git/git] Sync with Git 2.56.1 Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `master` Branches Tags History `git / Documentation / git-stripspace.adoc` 95 lines ยท 1967 bytes Raw Blame History 1 git-stripspace(1) 2 ================= 3 4 NAME 5 ---- 6 git-stripspace - Remove unnecessary whitespace 7 8 9 SYNOPSIS 10 -------- 11 [verse] 12 'git stripspace' [-s | --strip-comments] 13 'git stripspace' [-c | --comment-lines] 14 15 DESCRIPTION 16 ----------- 17 18 Read text, such as commit messages, notes, tags and branch 19 descriptions, from the standard input and clean it in the manner 20 used by Git. 21 22 With no arguments, this will: 23 24 - remove trailing whitespace from all lines 25 - collapse multiple consecutive empty lines into one empty line 26 - remove empty lines from the beginning and end of the input 27 - add a missing '\n' to the last line if necessary. 28 29 In the case where the input consists entirely of whitespace characters, no 30 output will be produced. 31 32 *NOTE*: This is intended for cleaning metadata. Prefer the `--whitespace=fix` 33 mode of linkgit:git-apply[1] for correcting whitespace of patches or files in 34 the repository. 35 36 OPTIONS 37 ------- 38 -s:: 39 --strip-comments:: 40 Skip and remove all lines starting with a comment character 41 (`core.commentChar`, default `#`). 42 43 -c:: 44 --comment-lines:: 45 Prepend the comment character and a blank space to each line. Lines will automatically 46 be terminated with a newline. On empty lines, only the comment character 47 will be prepended. 48 49 EXAMPLES 50 -------- 51 52 Given the following noisy input with '$' indicating the end of a line: 53 54 --------- 55 |A brief introduction $ 56 | $ 57 |$ 58 |A new paragraph$ 59 |# with a commented-out line $ 60 |explaining lots of stuff.$ 61 |$ 62 |# An old paragraph, also commented-out. $ 63 | $ 64 |The end.$ 65 | $ 66 --------- 67 68 Use 'git stripspace' with no arguments to obtain: 69 70 --------- 71 |A brief introduction$ 72 |$ 73 |A new paragraph$ 74 |# with a commented-out line$ 75 |explaining lots of stuff.$ 76 |$ 77 |# An old paragraph, also commented-out.$ 78 |$ 79 |The end.$ 80 --------- 81 82 Use 'git stripspace --strip-comments' to obtain: 83 84 --------- 85 |A brief introduction$ 86 |$ 87 |A new paragraph$ 88 |explaining lots of stuff.$ 89 |$ 90 |The end.$ 91 --------- 92 93 GIT 94 --- 95 Part of the linkgit:git[1] suite