├── CITATION.cff ├── CODE_OF_CONDUCT.md └── README.md /CITATION.cff: -------------------------------------------------------------------------------- 1 | cff-version: 1.2.0 2 | title: Git branch name 3 | message: >- 4 | If you use this work and you want to cite it, 5 | then you can use the metadata from this file. 6 | type: software 7 | authors: 8 | - given-names: Joel Parker 9 | family-names: Henderson 10 | email: joel@joelparkerhenderson.com 11 | affiliation: joelparkerhenderson.com 12 | orcid: 'https://orcid.org/0009-0000-4681-282X' 13 | identifiers: 14 | - type: url 15 | value: 'https://github.com/joelparkerhenderson/git-branch-name/' 16 | description: Git branch name 17 | repository-code: 'https://github.com/joelparkerhenderson/git-branch-name/' 18 | abstract: >- 19 | Git branch name 20 | license: See license file 21 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | 2 | # Contributor Covenant Code of Conduct 3 | 4 | ## Our Pledge 5 | 6 | We as members, contributors, and leaders pledge to make participation in our 7 | community a harassment-free experience for everyone, regardless of age, body 8 | size, visible or invisible disability, ethnicity, sex characteristics, gender 9 | identity and expression, level of experience, education, socio-economic status, 10 | nationality, personal appearance, race, caste, color, religion, or sexual 11 | identity and orientation. 12 | 13 | We pledge to act and interact in ways that contribute to an open, welcoming, 14 | diverse, inclusive, and healthy community. 15 | 16 | ## Our Standards 17 | 18 | Examples of behavior that contributes to a positive environment for our 19 | community include: 20 | 21 | * Demonstrating empathy and kindness toward other people 22 | * Being respectful of differing opinions, viewpoints, and experiences 23 | * Giving and gracefully accepting constructive feedback 24 | * Accepting responsibility and apologizing to those affected by our mistakes, 25 | and learning from the experience 26 | * Focusing on what is best not just for us as individuals, but for the overall 27 | community 28 | 29 | Examples of unacceptable behavior include: 30 | 31 | * The use of sexualized language or imagery, and sexual attention or advances of 32 | any kind 33 | * Trolling, insulting or derogatory comments, and personal or political attacks 34 | * Public or private harassment 35 | * Publishing others' private information, such as a physical or email address, 36 | without their explicit permission 37 | * Other conduct which could reasonably be considered inappropriate in a 38 | professional setting 39 | 40 | ## Enforcement Responsibilities 41 | 42 | Community leaders are responsible for clarifying and enforcing our standards of 43 | acceptable behavior and will take appropriate and fair corrective action in 44 | response to any behavior that they deem inappropriate, threatening, offensive, 45 | or harmful. 46 | 47 | Community leaders have the right and responsibility to remove, edit, or reject 48 | comments, commits, code, wiki edits, issues, and other contributions that are 49 | not aligned to this Code of Conduct, and will communicate reasons for moderation 50 | decisions when appropriate. 51 | 52 | ## Scope 53 | 54 | This Code of Conduct applies within all community spaces, and also applies when 55 | an individual is officially representing the community in public spaces. 56 | Examples of representing our community include using an official e-mail address, 57 | posting via an official social media account, or acting as an appointed 58 | representative at an online or offline event. 59 | 60 | ## Enforcement 61 | 62 | Instances of abusive, harassing, or otherwise unacceptable behavior may be 63 | reported to the community leaders responsible for enforcement at 64 | [INSERT CONTACT METHOD]. 65 | All complaints will be reviewed and investigated promptly and fairly. 66 | 67 | All community leaders are obligated to respect the privacy and security of the 68 | reporter of any incident. 69 | 70 | ## Enforcement Guidelines 71 | 72 | Community leaders will follow these Community Impact Guidelines in determining 73 | the consequences for any action they deem in violation of this Code of Conduct: 74 | 75 | ### 1. Correction 76 | 77 | **Community Impact**: Use of inappropriate language or other behavior deemed 78 | unprofessional or unwelcome in the community. 79 | 80 | **Consequence**: A private, written warning from community leaders, providing 81 | clarity around the nature of the violation and an explanation of why the 82 | behavior was inappropriate. A public apology may be requested. 83 | 84 | ### 2. Warning 85 | 86 | **Community Impact**: A violation through a single incident or series of 87 | actions. 88 | 89 | **Consequence**: A warning with consequences for continued behavior. No 90 | interaction with the people involved, including unsolicited interaction with 91 | those enforcing the Code of Conduct, for a specified period of time. This 92 | includes avoiding interactions in community spaces as well as external channels 93 | like social media. Violating these terms may lead to a temporary or permanent 94 | ban. 95 | 96 | ### 3. Temporary Ban 97 | 98 | **Community Impact**: A serious violation of community standards, including 99 | sustained inappropriate behavior. 100 | 101 | **Consequence**: A temporary ban from any sort of interaction or public 102 | communication with the community for a specified period of time. No public or 103 | private interaction with the people involved, including unsolicited interaction 104 | with those enforcing the Code of Conduct, is allowed during this period. 105 | Violating these terms may lead to a permanent ban. 106 | 107 | ### 4. Permanent Ban 108 | 109 | **Community Impact**: Demonstrating a pattern of violation of community 110 | standards, including sustained inappropriate behavior, harassment of an 111 | individual, or aggression toward or disparagement of classes of individuals. 112 | 113 | **Consequence**: A permanent ban from any sort of public interaction within the 114 | community. 115 | 116 | ## Attribution 117 | 118 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], 119 | version 2.1, available at 120 | [https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1]. 121 | 122 | Community Impact Guidelines were inspired by 123 | [Mozilla's code of conduct enforcement ladder][Mozilla CoC]. 124 | 125 | For answers to common questions about this code of conduct, see the FAQ at 126 | [https://www.contributor-covenant.org/faq][FAQ]. Translations are available at 127 | [https://www.contributor-covenant.org/translations][translations]. 128 | 129 | [homepage]: https://www.contributor-covenant.org 130 | [v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html 131 | [Mozilla CoC]: https://github.com/mozilla/diversity 132 | [FAQ]: https://www.contributor-covenant.org/faq 133 | [translations]: https://www.contributor-covenant.org/translations 134 | 135 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Git branch name 2 | 3 | This page has git branch name ideas that we've gathered. We welcome feedback. 4 | 5 | Contents: 6 | 7 | * [Git branch naming conventions](#git-branch-naming-conventions) 8 | * [Git commit message](#git-commit-message) 9 | * [Emoji](#emoji) 10 | * [Issue number](#issue-number) 11 | * [Version number](#version-number) 12 | * [Date-time stamp](#date-time-stamp) 13 | * [Group names](#group-names) 14 | * [Workflow prefix](#workflow-prefix) 15 | * [Name tokenization](#name-tokenization) 16 | * [Kebab case or snake case or camel case](#kebab-case-or-snake-case-or-camel-case) 17 | * [Slash separator](#slash-separator) 18 | * [Git branch edit description](#git-branch-edit-description) 19 | * [Git alias](#git-alias) 20 | * [See also](#see-also) 21 | 22 | 23 | ## Git branch naming conventions 24 | 25 | 26 | ### Git commit message 27 | 28 | Use direct imperative text, akin to a git commit message, that says what the branch does when it's merged. 29 | 30 | Examples: 31 | 32 | * add-help-button 33 | 34 | * fix-page-layout 35 | 36 | * optimize-search-speed 37 | 38 | Benefits: easy to understand the purpose, easy for inter-team communications. 39 | 40 | 41 | ### Emoji 42 | 43 | Use a branch name with an emoji that's akin to an icon, colorful, and fun. 44 | 45 | Examples: 46 | 47 | * 🙂login-button (a smiling face emoji means add a feature) 48 | 49 | * 🐛table-layout (a bug emoji means fix a bug) 50 | 51 | * 🐇page-speed (a rabbit emoji means optimize an area to make it faster) 52 | 53 | 54 | Benefits: easy to skim visually, fun for casual participants, creative. 55 | 56 | 57 | ### Issue number 58 | 59 | Use a branch name with an issue number based on your issue tracker, for example your issue tracker has issue number 100 and your branch name could be "100-foo-bar". 60 | 61 | Examples: 62 | 63 | * 100-add-login-button 64 | 65 | * 101-fix-table-layout 66 | 67 | * 102-optimize-page-speed 68 | 69 | Benefits: easy to jump between the issue tracker and the branch name. 70 | 71 | 72 | ### Version number 73 | 74 | Use a branch name with a version number, for example a branch for version 1.0.0 could be "1.0.0-foo-bar". 75 | 76 | Examples: 77 | 78 | * 1.0.0-add-login-button 79 | 80 | * 1.0.1-fix-table-layout 81 | 82 | * 1.1.0-optmize-page-speed 83 | 84 | Benefits: easy to see version ranges, group them, and also delete them when the version is done. 85 | 86 | 87 | ### Date-time stamp 88 | 89 | Use a branch name with a date or time, for example a branch created on January 1 2020 could be "2020-01-01-foo-bar". 90 | 91 | Examples: 92 | 93 | * 2020-01-01-add-login-button 94 | 95 | * 2020-01-02-fix-table-layout 96 | 97 | * 2020-01-03-optimze-page-speed 98 | 99 | Benefits: easy to see time ranges, group them, and also expire them after enough time has passed. 100 | 101 | 102 | ### Group name 103 | 104 | Use a branch name with your own group names, for example authentication/authorization could use "aa", or user interface branch could use "ui", or optimization opportunities could use "oo". 105 | 106 | Examples: 107 | 108 | * aa-login-button 109 | 110 | * ui-table-layout 111 | 112 | * oo-page-speed 113 | 114 | Benefits: easy to cluster by subteam, for example a security team looks at "aa", a design team looks at "ui", and a performance team looks at "oo". 115 | 116 | 117 | ### Workflow tag 118 | 119 | Use a branch name with your own workflow tag name, for example work in progress could use the tag name "wip", or a branch ready for user acceptance testing could use the tag name "uat", or a temporarly research branch could start with the tag name "tmp". 120 | 121 | Examples: 122 | 123 | * wip-login-button 124 | 125 | * uat-table-layout 126 | 127 | * tmp-page-speed 128 | 129 | Benefits: easy to understand in terms of customer delivery planning, if the teams are able to update their branch names as the branches reach various stages of delivery. 130 | 131 | 132 | ## Name tokenization 133 | 134 | 135 | ### Kebab case or snake case or camel case 136 | 137 | Use a branch name with kebab case which means dashes, or snake case which means underscores, or camel case which means use upper-case letters instead of a separator characters. 138 | 139 | Examples: 140 | 141 | * add-login-button (kebab case) 142 | 143 | * fix_table_layout (snake case) 144 | 145 | * optimizePageSpeed (camel case) 146 | 147 | 148 | ### Slash separator 149 | 150 | Use a slash "/" to simulate a directory and subdirectory. 151 | 152 | Examples: 153 | 154 | * features/login-button 155 | 156 | * fixes/table-layout 157 | 158 | * optmizations/page-speed 159 | 160 | Benefits: if you use a git GUI client that treats a slash "/" as a directory separator, then you may enjoy this kind of organization. 161 | 162 | Caveats: Git branch names do not use directories, and many git clients and sites ignore the slash. Branches are implemented as paths, so you cannot have a branch named "foo" and another branch named "foo/bar". 163 | 164 | 165 | ## Git branch edit description 166 | 167 | To add more information to a branch, we edit the branch description, for example to say the purpose of the branch, or contact information for the maintainers, or links to issue tracker items. 168 | 169 | To edit a branch description: 170 | 171 | ```sh 172 | git branch --edit-description 173 | ``` 174 | 175 | To see a branch description: 176 | 177 | ```sh 178 | git config branch..description 179 | ``` 180 | 181 | To set a branch description to one line: 182 | 183 | ```sh 184 | git config branch..description "This is an example description" 185 | ``` 186 | 187 | 188 | ### Git alias 189 | 190 | To use a git alias, edit your git config file (such as `~/.gitconfig`) and add these git aliases: 191 | 192 | 193 | ```sh 194 | bd = !"git config branch.$(git rev-parse --abbrev-ref HEAD 2>/dev/null).description" 195 | be = branch --edit-description 196 | ``` 197 | 198 | To set the current branch description: 199 | 200 | ```sh 201 | git bd "This is an example branch" 202 | ``` 203 | 204 | To see the current branch description: 205 | 206 | ```sh 207 | git bd 208 | ``` 209 | 210 | To edit the current branch description: 211 | 212 | ```sh 213 | git be 214 | (launches your editor) 215 | ``` 216 | 217 | 218 | ## See also 219 | 220 | Our related repos: 221 | 222 | * [Git commit message: how to write a great git commit message and commit template for version control](https://github.com/joelparkerhenderson/git_commit_message) 223 | 224 | * [GitHub special files and paths, such as README, LICENSE, /.github, /docs](https://github.com/joelparkerhenderson/github_special_files_and_paths) 225 | 226 | * [Git commit template for better commit messages](https://github.com/joelparkerhenderson/git_commit_template) 227 | 228 | 229 | Git branch organization: 230 | 231 | * [A successful git branching model by Vincent Driessen](https://nvie.com/posts/a-successful-git-branching-model/) 232 | 233 | * [How to organize your git branches by Darío Kondratiuk](https://dev.to/hardkoded/how-to-organize-your-git-branches-4dci) 234 | 235 | 236 | Git alias ideas: 237 | 238 | * [GitAlias](https://github.com/gitalias/gitalias) 239 | --------------------------------------------------------------------------------