DEV Community

Cover image for Be a better developer with these Git good practices

Be a better developer with these Git good practices

Anthony Vinicius on February 16, 2024

If you're a developer, you probably use the versioning system called Git on a daily basis. The use of this tool is crucial for the development proc...
Collapse
 
reenatoteixeira profile image
Renato Teixeira

really nice article! I'm practicing these GIT standards actually, thanks for sharing! 😊

Collapse
 
pradumnasaraf profile image
Pradumna Saraf

Good one!

Collapse
 
glowiep profile image
Gloria Lim

This is a great summary! Thank you!!

Collapse
 
kecbm profile image
Klecianny Melo

Excellent article! Maintaining standardization in our daily lives is essential 😁

Collapse
 
irungudennisnganga profile image
irungu d

A really nice article to read, it's worth it

Collapse
 
michaeltharrington profile image
Michael Tharrington

Good one, Anthony! Thanks for sharing this with us. 🙌

Collapse
 
dimitarkostov333 profile image
Dimitar

This whole debate is irrelevant, just use whatever you are comfortable with. Using Vim doesnt make you more efficient or productive. You know what makes you quicker and more productive? Knowing how to code...

Collapse
 
oculus42 profile image
Samuel Rouse • Edited

These are great recommendations and resources! Thanks for putting this together!

One addition that we usually add is the commit message should include the work ticket number if you are using a ticketing system. This can be a huge help as it connects the commit to whatever additional details, resources, and conversations are associated with the ticket, and can be really helpful for understanding context when looking at old commits.

Collapse
 
danielhe4rt profile image
Daniel Reis

Gitflow is something that people barely talk about. Just spam "conventional commits" without showing practical examples is kinda useless.

Really great article, loved how you explained these topics :D

Collapse
 
thenickest profile image
TheNickest

I just started to apply them. I am happy to see that I am on the right path. However, I had the feeling that at sometimes it feels limiting. I struggled finding the right words. Could also be me of course..

Collapse
 
seandinan profile image
Sean Dinan

Adding to the bit about including Jira issue keys, including them in your commit message will auto-link them in BitBucket (e.g. git commit -m "Refactor LoginDialog" -m "WTM-305")

Collapse
 
silvergraphs profile image
Bruno Caruso

Using Conventional Commits everything in commit title goes in lower-case?

Collapse
 
anthonyvii profile image
Anthony Vinicius

Yes! lower-case and hyphen to separate

Collapse
 
silvergraphs profile image
Bruno Caruso

Thank you for reply, Anthony :)

Collapse
 
ludamillion profile image
Luke Inglis

A nice feature of the / separator is that in many UI interfaces will use that to infer a directory structure.

Collapse
 
twinbird24 profile image
Attila Komaromi • Edited

This is great, I generally try to use these conventions on the projects I'm on—however, I've never heard of the commit type. Personally, I think it's unnecessary and adds more overhead than needed—the subject itself should be enough. If your commits are part of a PR, then the PR title should already be descriptive enough to encapsulate the general category of commits.

Collapse
 
uiuxsatyam profile image
Satyam Anand

Insightful post 🔥 @anthonyvii

Even I used to do conventional commits before but when I realised that few practices can level up you as a Developer, I started using standard commits that made other developers in my team feel overwhelmed.

Remember, you are not alone coding the entire project in any organisation. Maintaining standards in your code helps maintain readability, contextual awareness and effecient collaboration.

Collapse
 
get_pieces profile image
Pieces 🌟

Awesome article!! 🔥 Will start practicing these Git practices.

Collapse
 
gregnoob profile image
George Alex

A very good article, easy to read and understand. Thank you for sharing.

Collapse
 
briancolfer profile image
Brian Colfer

I’ve worked with teams that did this and it slows things down for little value.

Collapse
 
ricardogesteves profile image
Ricardo Esteves

Nice and really informative article @anthonyvii !

Collapse
 
jangelodev profile image
João Angelo

Hi Anthony Vinicius,
Your tips are very useful
Thanks for sharing

Collapse
 
valvic66 profile image
Micu Valentin

Good and simple. Thanks.

Collapse
 
rudransh61 profile image
Rudransh Bhardwaj

Saving this masterpiece

Collapse
 
anthonyvii profile image
Anthony Vinicius

Thanks!!

Collapse
 
githubcloud profile image
Cloud

I normally use underscore "_" instead of hyphen "-", any wrong with that?

Collapse
 
anthonyvii profile image
Anthony Vinicius

No, those practices are optional, and you don't need to follow each one. If your team doesn't have a defined pattern, you don't need to use a hyphen. Some people say that the practice of using a hyphen makes the subject more readable than using an underscore, but it's optional.

Collapse
 
naviny0 profile image
Navin Yadav

nice one

Collapse
 
anthonyvii profile image
Anthony Vinicius

Thanks!!

Collapse
 
sachingeek profile image
Sachin

Great one

Collapse
 
pusonja profile image
Darko

Thanks a lot...tips are very helpful!

Collapse
 
rahulrajesh profile image
Rahul Rajesh

really nice article

Collapse
 
anthonyvii profile image
Anthony Vinicius

Thanks!!

Collapse
 
pixelvortex profile image
Ayoum Soumah

Great info! Thank you :)

Collapse
 
coderex profile image
Aaron Kudadjie

Have learnt a lot from this article. Thank you.

Collapse
 
victordep profile image
vuongvgc

Nice, super thanks. I wish I can read this post when I am student

Collapse
 
cuongnp profile image
cuongnp

It's really helpful, even though I've been using Git for years. Regards!

Collapse
 
aneesh_balan profile image
Aneesh Balan

Really great article 🔥

Collapse
 
lapp1stan profile image
Stanislav Kniazev

What about avoiding force pushes and git reflog recovery for such cases? 🧐

Collapse
 
beacamphq profile image
BeacampHQ

This is a useful guide! 🔥

Collapse
 
muhammadazis profile image
Muhammad Azis Husein

These small things sometimes missed from our day-to-day works, especially for the convention of commit message. Thanks for remind us!

Collapse
 
manhniori profile image
TheManhPham

good one

Collapse
 
fabiorodriguesroque profile image
Fábio Roque

Thanks for your recommendations, I'm trying to follow these practices on my projecs!

Collapse
 
michaljacks51 profile image
michaljackes

Thanks for highlighting the importance of Git good practices! Clear commit messages and proper branch management can greatly improve collaboration and kidnapping project organization.

Collapse
 
asfiaaiman profile image
Asfia Aiman

What a tutorial man!

Bravo

Collapse
 
bnystrom profile image
Bryan Nystrom

The "Conventional Commits" section doesn't seem to follow the previous "Capitalize the first letter of the subject line"?

Collapse
 
india12334 profile image
indiawalkthrough