From: Kevin Daudt <me@ikke.info>
To: Tomas <correo@tomaszubiri.com>
Cc: git <git@vger.kernel.org>
Subject: Re: commiting a change from command line with newlines.
Date: Fri, 3 Jul 2020 07:14:22 +0200 [thread overview]
Message-ID: <20200703051422.GB2450243@alpha> (raw)
In-Reply-To: <17312e90c37.fefa495d137526.1559287962218705021@tomaszubiri.com>
On Fri, Jul 03, 2020 at 01:22:09AM -0300, Tomas wrote:
> 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.
>
git commit accepts multiple `-m` arguments, where each message will be
concattenaed with two newline characters.
So `git commit -m "add foo to bar" -m "foo is necessary to allow bar to
..." -m "baz would not work in this case because.."`
Would turn out as:
> add foo to bar
>
> foo is necessary to allow bar to...
>
> baz would not work in this case beacuse..
Hope this helps,
Kevin
prev parent reply other threads:[~2020-07-03 5:21 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-03 4:22 commiting a change from command line with newlines Tomas
2020-07-03 4:54 ` Junio C Hamano
2020-07-03 4:55 ` brian m. carlson
2020-07-03 5:14 ` Kevin Daudt [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200703051422.GB2450243@alpha \
--to=me@ikke.info \
--cc=correo@tomaszubiri.com \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.