Forem

Cover image for Git Branches
Winnie Magoma
Winnie Magoma

Posted on β€’ Edited on

2 2

Git Branches

This is something that has been bugging me for the better part of my Sunday afternoon. In what scenarios should I use a branch or branches when working on my on git through Github or other existing DVCS? Can I use it when working on personal projects or it is only suitable for collaborative projects?

Top comments (4)

Collapse
 
rhymes profile image
rhymes β€’

I use branches all the time, some end up being public (for a pull request for example, in a collaborative project), some are private to test new ideas or implement features.

Basically every time a change is not trivial I use a branch.

Collapse
 
winniebosy profile image
Winnie Magoma β€’

Implementing new features without necessarily interfering with the master branch...I get it now...Thank you πŸ˜€

Collapse
 
kaka profile image
Ruto Collins β€’

Yes, use branches every time - to avoid the trouble of figuring out what changes broke your system and trying to revert. Basically create a new branch, work from it, then if you're comfortable with, raise a pull request on Github and merge the new branch to the base branch.

And oh, just asking, have you gotten your internship yet? From your profile you were currently looking...

Collapse
 
winniebosy profile image
Winnie Magoma β€’

Thanks Collins..It makes more sense now..I do not want to imagine the hustle of a broken project...

Sentry image

See why 4M developers consider Sentry, β€œnot bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

πŸ‘‹ Kindness is contagious

Dive into an ocean of knowledge with this thought-provoking post, revered deeply within the supportive DEV Community. Developers of all levels are welcome to join and enhance our collective intelligence.

Saying a simple "thank you" can brighten someone's day. Share your gratitude in the comments below!

On DEV, sharing ideas eases our path and fortifies our community connections. Found this helpful? Sending a quick thanks to the author can be profoundly valued.

Okay