3 ms·
I'll add some more I find useful: 1. Use All lower case. It's impossible to be consistent with any other case (except all upper case). This is important. Git d
by alkonaut 7y ago
I'll add some more I find useful:
1. Use All lower case. It's impossible to be consistent with any other case (except all upper case). This is important. Git does NOT like case insensitive file systems, and people having two branches with a segment with different case causes problems.
2. Use path segments to group branches. Categories can be versions or a specific team or user e.g. version/v1.0 or topic/desktop/123-add-printing-support or /topic/jimbob/123-add-printing-support Many systems will display these segments in a tree structure so you can quickly navigate all branches of a specific kind e.g. all your ongoing work separate from 20 version maintenance branches.
3. When making branches to cherry pick hotfixes to a different branch, include the new target branch in the branch name to avoid confusion. E.g. topic/123-fix-blank-password-always-accepted and topic/blank-passsword-always-accepted-on-version-v1.0
- halostatue 7y agoI discourage people from using path parts, because git actually treats it like a path—and I’ve seen some conflicts with this. Better to just use hyphens as separators and forget that you can use slashes at all. Totally agree on all lower case.
- FalconSensei 7y agoYeah, I've had problems by using '/' on branch names. When you have something like origin/jira/PROJ1-123/DoThisThing, some commands don't like. If there's no good reason to do that, just don't.
- Ayesh 7y agoI'm starting to like slashes in branch names. They are so easy to visually grasp a list of branches. Do you recall any of the problems you had? I'm frequently using checkout/rebase/merge workflow and never had any problems. But I always felt I am not using all features got had to offer.
- halostatue 7y agoI had a recent situation where someone had created a branch called `something/some-reason` and I had a branch called `something` that already existed locally. I was unable to check out `something/some-reason` because `something` already existed as a file. Slashes in branch names are BAD ideas and should be avoided.