Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Is there a way to add an optional description to a commit like in GitHub?

Lucas Thiel October 16, 2014

In GitHub a commit message consists of a title and an optional description of the commit. In Bitbucket however I can only enter a commit message without a description. Can I change that?

3 answers

1 vote
tlroche October 17, 2014

@Lucas Thiel: "In GitHub a commit message consists of a title and an optional description of the commit."

You're confusing git (which is what you use to commit) and GitHub (a host for remote git repositories). A git commit message is just text--that's true whether your repo is on your box or GitHub's or Bitbucket's. However, you can sorta create a "title" (typically summarizing the rest of the commit) by separating it from the rest of the commit text with ... \n\n !-) This I do regularly, for more substantive commits. The nice part of this is, only the first line displays in your project's Commits page, while the rest of the commit message displays in the page for that particular commit. For example, see commit=48dd2e5 in the middle of https://bitbucket.org/tlroche/ioapi_spatiotemporality_checker/commits/all : you see just the "title"=="(all tests pass) test gates passed by driver, used by NCL". However, if you click the link to the commit https://bitbucket.org/tlroche/ioapi_spatiotemporality_checker/commits/48dd2e5eb186d7e76d03e7eb275f3a60cecd5bfa you see all the "gory detail."

You can do this (create a multiline commit) using `git commit -m` and a multiline quote, but I prefer (since I take my commit messages seriously, as project documentation) to compose a text file (which also allows me to use my editor's facilities, not merely those of my shell) and then do `git commit -F /path/to/file` . YMMV.

0 votes
Shakir Moledina January 25, 2020

I tried it on SourceTree 3.1.3 and to add a title and description, enter the it in the following format

Title

1. Description
2. Description

There should be one line separating the title and description (hence the \n\n ). Sourcetree should be able to distinguish the title from the description.

0 votes
Seth
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 16, 2014

As far as I know, Git commit messages are just one field (call it title or description, whatever floats your boat). I'm not sure how GitHub implements separate title vs description in a way that Git clients can understand.

In the meantime, I would treat Bitbucket commit messages as "description with no title", rather than "title with no description".

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events