DEV Community

Git Branch Naming Convention

couchcamote on March 31, 2020

Working on a big company with projects that could scale from a one-man team then suddenly to a 20 developers team, having a manageable code reposit...
Collapse
 
shvahabi profile image
Shahed • • Edited

Very thorough summary of all usual conventions. Just want to add after the Black Lives Matter movement, git provided option to use names other than master, the option is: git init --initial-branch=stable. Hence technically speaking master is deprecated in favour of other names such as stable or main.

Collapse
 
jstewart8053 profile image
jstewart8053 • • Edited

You mean after the Black Lives Matter movement. It's not a 'thing'. smh
Very helpful post though, what do you think about emojis in commits? I have seen a lot on the issue lately.

Collapse
 
shvahabi profile image
Shahed • • Edited

Sure you are right, since English is not my native language 😅. The correct word is movement, and thanks. I edited my original reply.

Thread Thread
 
jstewart8053 profile image
jstewart8053 •

No worries :)

Thread Thread
 
gitbusycoding profile image
Ravi Ponamgi •

Liked "No worries", considering the OP was made with the best of intentions.

Collapse
 
federicoaguilar profile image
federico •

2024 and this post is still awesome.

For those who are interested in naming conventions for commits, I found this post that builds on this one.

Collapse
 
clifton893 profile image
Clifton Long Jr. •

Great post, and very helpful! 😄

Collapse
 
zeedu_dev profile image
Eduardo Zepeda •

This is so useful, most people should read this post.

Collapse
 
slidenerd profile image
slidenerd • • Edited

What do you call a branch where you start a python project empty, add a gitignore, readme, poetry, tox, pre-commit, add a main.py setup pyproject.toml install pytest and run some tests inside the tests directory which you also create

Collapse
 
evilkittenlord profile image
EvilKittenLord •

Everything needs a naming scheme. :)
Folks might be interested in the naming scheme I've been using that enables automatic semver detection.
github.com/marketplace/actions/git...

Collapse
 
robertotonino profile image
Roberto Tonino •

Great post, thanks! Definitely gonna use this convention :)

I would suggest a branch for dependencies upgrading too (expecially ones with breaking changes), what do you think?

Collapse
 
couchcamote profile image
couchcamote • • Edited

Glad to have helped.
For new dependencies upgrading we can consider that as a new feature. Basically, it is like new code changes with new libraries and code updated to use them. It should also follow the dev-test-stage-prod flow and it usually has planned schedule for release.

Collapse
 
jonyx profile image
jonyx •

Thanks for your post,

Collapse
 
ahmadf20 profile image
ahmad faaiz •

Great! Thanks~

Collapse
 
gitbusycoding profile image
Ravi Ponamgi •

Great summary!

Collapse
 
djaegerscript profile image
Adjie Djaka Permana •

Much new knowledge, thanks for sharing it