DEV Community

Discussion on: Git commits: An Effective Style Guide

Collapse
 
andrespineros profile image
Andrés Felipe Piñeros

I saw something a co-worker does and I really liked it.

It is as simple as addind the Jira issue number and the short name of the person that did the commit.

Like "841-RickM-bug fixed bug blah blah"

Reading commits from the develop and master branch is pure joy this way. Like, everything makes sense.

Collapse
 
scottharrisondev profile image
Scott Harrison

We use BitBucket and Jira and when you add the issue number to the commit it links it in Jira too so you can go directly to the commit in BitBucket. Pretty cool stuff!

Collapse
 
moopet profile image
Ben Sinclair

Why would you add the user's name? That only takes up room in the short version of the commit message, and you can see their name in the log anyway.

Collapse
 
pavlosisaris profile image
Paul Isaris

Cool, that also works like a charm, especially for short commits. On larger ones, you might need to add multiple lines ;)

Collapse
 
alainvanhout profile image
Alain Van Hout

or split up the long commit into several short ones :)

Thread Thread
 
pavlosisaris profile image
Paul Isaris

Of course! Just keep making sure that you can easily navigate through the commit history.

Collapse
 
jackedwardlyons profile image
Jack Lyons

Adding the username and / or trello/jira id/hash to your git branch is also pretty helpful in a team environment.

Eg, instead of 'new-bug-fix' ... you can write 'jlyons-idea1234-new-bug-fix'

Collapse
 
mvz profile image
Matijs van Zuijlen

Isn't the author already recorded as part of the commit anyway?