git/list[1] front-page[2] threads[3] people[4] search[5] about
 

commiting a change from command line with newlines.

From
TTomas <correo@tomaszubiri.com>
Date
Jul 3, 2020, 04:22 UTC
Message-ID
<17312e90c37.fefa495d137526.1559287962218705021@tomaszubiri.com>
Hello,
I'm trying to write stanzas in my commit message, and naturally the ASCII newline character is the best tool for this, beautifully integrated throughout my whole system, from my keyboard to my screen.
My question is, how can I add a newline from the git command line without opening an external program like vi, atom, notepad, word etc...
Since I'm using a unix like system I even tried with pipes (and xargs, the necessary evil) but with something like "printf "a\nb" | xargs git commit -m" b gets interpreted as something else. 

Does anybody know of a way to adorn a commit message with newlines in a single git commit command? Thanks in advance.

Next: Junio C Hamano
Message 1 of 4 in “commiting a change from command line with newlines.”
  1. TomasJul 3, 2020
  2. Junio C HamanoJul 3, 2020
  3. brian m. carlsonJul 3, 2020
  4. Kevin DaudtJul 3, 2020

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.