DEV Community

Cover image for Git Branches
Winnie Magoma
Winnie Magoma

Posted on • Updated on

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...