I want commit with message and Extended description text to Bitbucket server. It exists on
Git-cola software and I need the command line of it. I am using ubuntu and I need terminal command for
git commit -am "My commit text" "My Extended description is this. Containing break lines in it."
Best How To :
There is no "extended description" concept in git. Only the commit message. What happens is that the commit message can have a single line or multiple lines.
External tools or websites such as git-cola or GitHub can interpret multiple lines commit messages as:
- The first line is a short description
- All the other lines are an extended description
For one line messages, only the "short description" is defined.
See Git hub commit with extended message for details.
As ckruczek suggested you can simply
git commit without option and a text editor will spawn, just write the first line as the short description and the rest as the extended description.
If you want to do it from the command line, you can use one of the options mentionned in this question: Add line break to git commit -m from command line.
For example with bash, you can do:
git commit -m 'Message
Or use the "here document" syntax:
git commit -F- <<EOF
PS: Examples are taken directly from the answer in Add line break to git commit -m from command line. Credits for Simon Ritcher and jpmc26.
As a third way, you could also use a temporary file:
echo $comment > message.tmp
echo $extended >> message.tmp
git commit -F message.tmp
There is also another option (also described in this question answer): You can specify multiple messages using the '
-m' option multiple times:
git commit -m "Short description" -m "Extended description"
Be careful as, specified this way, messages will be treated as paragraph, thus beeing separated by an empty line.
From the online git doc:
Use the given <msg> as the commit message. If multiple -m options are given, their values are concatenated as separate paragraphs.