git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Tomas <correo@tomaszubiri.com>
Cc: "git" <git@vger.kernel.org>
Subject: Re: commiting a change from command line with newlines.
Date: Thu, 02 Jul 2020 21:54:05 -0700	[thread overview]
Message-ID: <xmqqk0zlb3ma.fsf@gitster.c.googlers.com> (raw)
In-Reply-To: <17312e90c37.fefa495d137526.1559287962218705021@tomaszubiri.com> (Tomas's message of "Fri, 03 Jul 2020 01:22:09 -0300")

Tomas <correo@tomaszubiri.com> writes:

> 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...

Just like you pass any command an argument that has newline(s) in
it, e.g.

    $ git commit -s -m 'area: teach gostak to distim doshes[ENTER]
    > [ENTER]
    > Gostaks inherently want to distim doshes, so let them do so[ENTER]
    > freely.' -a[ENTER]

you can give such a string to "git commit" as an argument to its
"-m" option.




  reply	other threads:[~2020-07-03  4:54 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 [this message]
2020-07-03  4:55 ` brian m. carlson
2020-07-03  5:14 ` Kevin Daudt

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

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqk0zlb3ma.fsf@gitster.c.googlers.com \
    --to=gitster@pobox.com \
    --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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).