{"id":23161184,"url":"https://github.com/shinjith-dev/git-conventions","last_synced_at":"2025-04-04T19:28:47.886Z","repository":{"id":246322410,"uuid":"820749620","full_name":"shinjith-dev/git-conventions","owner":"shinjith-dev","description":"Git naming conventions for branches and commit messages","archived":false,"fork":false,"pushed_at":"2024-06-27T05:36:04.000Z","size":4,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-10T04:29:40.590Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/shinjith-dev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-06-27T05:33:31.000Z","updated_at":"2024-06-27T05:36:25.000Z","dependencies_parsed_at":"2024-06-27T06:54:18.615Z","dependency_job_id":null,"html_url":"https://github.com/shinjith-dev/git-conventions","commit_stats":null,"previous_names":["shinjith-dev/git-good"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shinjith-dev%2Fgit-conventions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shinjith-dev%2Fgit-conventions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shinjith-dev%2Fgit-conventions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shinjith-dev%2Fgit-conventions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shinjith-dev","download_url":"https://codeload.github.com/shinjith-dev/git-conventions/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247237076,"owners_count":20906233,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-17T23:13:37.789Z","updated_at":"2025-04-04T19:28:47.869Z","avatar_url":"https://github.com/shinjith-dev.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Git Naming Conventions\n\nGit naming conventions for branches and commit messages \n\n## Why should I follow the standards?\n\n- **Clarity and Understanding**\n\n- **Collaboration and Teamwork**\n\n- **Ease of Navigation and Maintenance**\n\n- **Documentation and Knowledge Transfer**\n\n- **Project Quality**\n\n- **Automated Changelogs**\n\n- **Optimizing CI/CD**\n\n## Before You Read \n\n- Each seb-section under **Branch Naming Conventions** and **Commit Message Conventions** are ordered as **basic**, **intermediate** and **advanced rules** respectively.\n\n- You can follow upto any level of rules based on use case and relevance, anyways following conventions upto **intermediate rules** level is recommended.\n\n- Following contents are adapted and organised from resources provided in the reference section.\n\n------\n\n## Branch Naming Conventions\n\n### Basics\n\n1. **Descriptive Names**: A well-named branch gives immediate context for its purpose. Instead of generic names, choose clarity.\nFor example: \n\n - `feature/login`\n\n - `bugfix/navbar-overflow`\n\n2. **Use Hyphens**: Use hyphens to seperate words (or kebab case) in branch name,  this ensures readability.\nFor instance,\n\n - `bugfix/fix-login-issue` is more readable than `bugfix/fixLoginIssue` or `bugfix/fix_login_issue`.\n\n3. **Alphanumeric Lowercase Characters**: Use only alphanumeric lowercase characters (a-z, 0–9) and hyphens. Avoid punctuation, spaces, underscores, or any special characters whenever possible.\n\n4. **Avoid Unneccessary Hyphens**: Avoid unneccessary hyphens, like subsequent or trailing hyphens.\nFor instance,\n\n - `feat/new--login-` is a bad practice.\n\n5. **Short and Effective**: Keep branch names simple. While descriptive, they should also be concise enough to convey the goal at a glance.\n\n### Prefix or Type\n\n- Prefixing branches helps to organize them according to their purpose. This not only improves clarity, but also helps to automate workflows.\n\n- Some of the common branch type prefixes and their usage cases include:\n\n  - `feature/`: For developing new features,\n\n  - `bugfix/`: To fix bugs in the code. Often created associated to an issue.\n\n  - `hotfix/`: To fix critical bugs in the production.\n\n  - `release/`: To prepare a new release, typically used to do tasks such as last touches and revisions.\n\n  - `docs/`: Used to write, modify or correct documentation.\n\n- For example, `feature/new-feature` or `release/version-1.0.0`.\n\n### Including Ticket Numbers\n\nIf your project employs an issue tracking system such as Jira, or if it revises based on github issues or another comparable tool. Including the token for the issue in the branch name would make it simple to track. Example:\n\n - `feature/PROJ-123-footer-links`\n\n------\n\n## Commit Message Conventions\n\n- Final format for a commit message:\n\n  ```md\n  \u003ctype\u003e([optional scope]): \u003cdescription\u003e  # subject\n\n  [optional body]\n\n  [optional footer(s)]\n  ```\n\n### Message Subject\n\n- **Imperative Mood**: Create commit messages in the imperative mood. Start with a verb to indicate what the commit does.\nFor example:\n\n - Use `fix: Fix bug #67` than `fix: Fixed bug #67`\n\n- **Short and Summarized**: Try to fit the subject line inside 50 characters to ensure that messages are readable in various Git tools, such as when using `git log --oneline`. Avoid trailing period and unneccessary words/symbols.\n\n- **Capitalize the description**: This is as easy as it sounds. Start subject line with a capital letter.\n\n### Type and Message Body\n\n- A `type` preifx in the subject line can be used to represent type of the changes included in the commit. Some of the commonly used types are:\n  \n  - `feat:`: To summarize a new feature in the codebase.\n\n  - `fix:`: To address a fix to the codebase.\n\n  - `build:`, `chore:`, `ci:`, `style:`, `refactor:` are some other examples.\n\n- A `scope` can be added to a commit's type to offer additional contextual information, and it is enclosed in parenthesis, for example, \n\n - `feat(parser): Add the ability to parse arrays`\n\n- A `body` can be added to the message to include detailed explanations in the commit.\n\n- Body is added by leaving a blank line after the subject line.\n\n- Wrap the body at 72 characters, ie. Use multple lines of body, where each line does not exceed 72 characters.\n\n## Footer and Extended Message Body\n\n- A `footer` is use to convey addiotional information regarding the commit, such as reviewed by, approved by, etc. Example:\n\n - `Signed-off-by: Alice \u003calice@example.com\u003e`\n\n- **Breaking Change**:  A `BREAKING CHANGE` refers to rather important major changes in the codebase. It can represented by adding a `!` after type/scope and/or by adding it with `body` or as `footer`\n\n  ```md\n  chore!: drop support for Node 6\n\n  BREAKING CHANGE: use JavaScript features not available in Node 6.\n  ```\n\n- **Multi-paragraph Body**: In some circumstances, numerous paragraphs help to explain the goal of the commit in greater detail. Example: To describe what, why, and how, about a commit changes.\n\n#### Examples\n\nVarious use case examples of commit messages may be found [here](https://www.conventionalcommits.org/en/v1.0.0/#examples).\n\n## Conclusion\n\nAdhering to Git conventions is similar to speaking a common language. However, it is obvious that these standards or conventions are not enforced by any system; hence, the adaptation and extension of use of these standards is entirely up to us.\n\nEmbracing these habits will surely improve your Git experience and encourage a collaborative coding environment. Even though we can't follow these in a single blow, gradually adapting to them will undoubtedly make a difference. \n\nHappy coding!\n\n## References\n\n- [Naming conventions for Git Branches — a Cheatsheet, by Abhay Amin](https://medium.com/@abhay.pixolo/naming-conventions-for-git-branches-a-cheatsheet-8549feca2534)\n\n- [Git conventions](https://se-education.org/guides/conventions/git.html)\n\n- [How to Write a Git Commit Message by CBEAMS](https://cbea.ms/git-commit)\n\n- [Git trailers](https://git-scm.com/docs/git-interpret-trailers)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshinjith-dev%2Fgit-conventions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshinjith-dev%2Fgit-conventions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshinjith-dev%2Fgit-conventions/lists"}