https://github.com/pshaddel/conventional-branch
Create Conventional Branch Name with Ability to Customize the Template
https://github.com/pshaddel/conventional-branch
conventional-branch git standard-naming vscode-extension
Last synced: about 2 months ago
JSON representation
Create Conventional Branch Name with Ability to Customize the Template
- Host: GitHub
- URL: https://github.com/pshaddel/conventional-branch
- Owner: pshaddel
- License: apache-2.0
- Created: 2023-02-19T08:53:25.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2025-06-28T11:05:25.000Z (5 months ago)
- Last Synced: 2025-09-18T13:49:59.061Z (about 2 months ago)
- Topics: conventional-branch, git, standard-naming, vscode-extension
- Language: TypeScript
- Homepage: https://marketplace.visualstudio.com/items?itemName=pshaddel.conventional-branch
- Size: 436 KB
- Stars: 13
- Watchers: 1
- Forks: 2
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# Conventional Branch


Conventional Branch" is a tool designed to help standardize branch names in Git for teams working on large projects. The extension allows you to choose from several pre-defined templates, which can be customized to suit your team's specific needs. Once a template is selected, you can easily create new branches with standardized names directly from your IDE. This helps to avoid confusion and promote consistency in branch naming conventions across the team. With "Conventional Branch", you can spend less time thinking about branch names and more time focusing on your work.
## Usage
You can access VSCode Conventional Branch by using
`Command + Shift + P` or `Ctrl + Shift + P`, enter `Conventional Branch`, and press Enter.
### How to Customize Branch Name Template
Got to User Settings > Conventionl Branch > format
You can change the default format and keep in mind that these are reserved keywords in this template: `Branch`, `TicketNumber` and `Type`.
Examples of templates:
* `{Author}/{Type}/JIRA-{TicketNumber}/{Branch}`
* `myGithubUserName/Trello-{IssueNumber}/{Branch}`
* `{Type}/{Branch}`
### How to add Conventional Branch setting to your Workspace Settings
In .vscode > settings.json you can use conventional branch settings.
```json
{
"conventional-branch.format": "{Author}/{Type}/JIRA-{TicketNumber}/{Branch}",
"conventional-branch.type": ["feature", "fix", "hotfix"],
"conventional-branch.branchNameSeparator": "-",
"conventional-branch.maxBranchNameLength": 50,
"conventional-branch.minBranchNameLength": 5,
"conventional-branch.forceBranchNameLowerCase": true,
"conventional-branch.removeBranchNameWhiteSpace": true
}
```
## Features
Base thing we are using is a format which is by default:
`{Type}/{TicketNumber}/{Branch}`
### Selector Fields
Selector Fields are the fields that you can select from the dropdown. Use Brackets for defining the selector fields. For example:`{MyType[A,B,C]}/JIRA-{TicketNumber}` will create a dropdown for `MyType` with options `A`, `B` and `C`.
### Reserved Keywords: `Type`, `Branch`
#### Type
It is a special name. It is an enum that contains different types of branch like `feat`, `bug` and some other options(you can change it via settings).
#### Branch
It is also something special. It is the branch name. By default some operations are enabled for branch name. For example we are removing the whitespaces. Or we are converting the text to lower case. These are customaizable options.
### Force Parent Branch
Sometimes you want to be sure that every branch you are making with the extension are from specific parent. For example `staging` branch.
For this you can use this setting: `forcedParentBranch`:
```javascript
{
"conventional-branch.forcedParentBranch": 'staging'
}
```
### Common Format Samples
The most commont one I found is this one:
```{Type}/{TicketNumber}-{Branch}```
Many code bases are using this format to add ticket number to the branch and at the same time also have a short description for the branch.
## Extension Settings
| Property | Description | Default Value |
| ---------------------------------------------- | ---------------------------------------------------------------------------------- | --------------------------------------------------------------------- |
| conventional-branch.type | An array that contains different type of branches. | ["feature","fix","hotfix","test","release"] |
| conventional-branch.branchNameSeparator | Branch string must be separated by something. It could be space, dash or anything. | "-" |
| conventional-branch.maxBranchNameLength | Set a maximum lenght for the branch name. | 50 |
| conventional-branch.forceBranchNameLowerCase | A boolean that converts branch name to lower case | true |
| conventional-branch.removeBranchNameWhiteSpace | Removes whitespaces from branch. | true |
| conventional-branch.format | Format for creating branch. | "{Type}/{TicketNumber}/{Branch}" |
| conventional-branch.minBranchNameLength | Minimum lengh for branch name. | 3 |
| conventional-branch.forcedParentBranch | Force Branches to be created from this specific branch | null |