Advertisement

Please help with a merge problem.

Started by March 19, 2020 01:17 PM
21 comments, last by Alberth 4 years, 6 months ago

One of my favorite sites for this kind of thing: https://ohshitgit.com/

I swear I'm there once a month…

Josheir said:

Well, I suppose it is all in the master history. The next branch has to be called something, though?

Indeed, the normal way to look to the history is by checking the destination of all branches, ie 'master'. As you merge branches into it, you get nice merge commits for free as well, keeping the commits of a branch together.

If you want to have more than 9 branches, I would likely use the date in reverse, ie 20200330, which is more likely to work long after branch ‘9z’ ?

Instead of a number, you can also give it a name that expresses the purpose or the feature, ie “add-joystick-support” as branch-name can be useful. If you more driven by issues, a common system is to use the issue number in the branch name, ie “30-fix-broken-scale” that apparently would fix issue 30, or at least address it. Obviously, using your own number instead of an issue number is a valid option too.

I generally have several branches “in progress” at the same time. I also have branches that never make it to master for a variety of reasons. Sometimes they are just experiments to see how it would work out in the code. At other times I realize I forgot to do a few things that I need, but they are big enough for their own feature, so I switch to that first in a new branch, merge to master, and then continue on the branch I left.

As normal with VCSes, git provides you with a collection of powerful generic tools, and you can decide how you want to use them.

This topic is closed to new replies.

Advertisement