-
Notifications
You must be signed in to change notification settings - Fork 4
Semantic branching
Semantic branching helps maintain a clear and organized version control system, facilitating collaboration and integration of features across the development lifecycle. The branch name should be included in the Issue description, so you can copy the name when creating a new branch
- Use the format
type/###-brief-description
for branch names, wheretype
is one of the following:-
feat or feature: New feature for the user.
- Example:
feature/001-user-authentication
- Example:
-
fix: Bug fix for the user.
- Example:
fix/002-fix-login-api
- Example:
-
docs: Changes to the documentation.
- Example:
docs/003-update-readme
- Example:
-
style: Code formatting, missing semicolons, etc. (no production code change).
- Example:
style/004-format-code
- Example:
-
refactor: Refactoring production code (e.g., renaming a variable).
- Example:
refactor/005-rename-variable
- Example:
-
test: Adding or refactoring tests (no production code change).
- Example:
test/006-add-unit-tests
- Example:
-
chore: Updating grunt tasks, etc. (no production code change).
- Example:
chore/007-update-dependencies
- Example:
-
feat or feature: New feature for the user.
-
From the GitHub issue view, click on "Create a branch for this issue" to create a branch directly tied to the issue. Use
develop
as the source branch. -
Ensure that the branch name matches the specified format for the task.
Example:
Branch name: feature/001-user-authentication
Command line instructions:
# Assuming you're currently on the `develop` branch git checkout develop git pull origin develop git checkout -b feature/001-user-authentication
-
Push your branch regularly to the remote repository to enable collaboration and integration.
git push origin feature/001-user-authentication
- When your task is complete, open a pull request (PR) from your branch into the
develop
branch. - Provide a concise description of the changes and reference the issue number.
- Collaborate with team members for code review.
- Address feedback and make necessary changes.
- After approval, merge your branch into
develop
using the repository's merge mechanism (e.g., GitHub PR merge button)
-
Branch Management: Delete feature branches after they are merged to keep the repository clean.
git branch -d feature/001-user-authentication # Delete local branch git push origin --delete feature/001-user-authentication # Delete remote branch
-
Naming Consistency: Ensure the branch name matches the specified format provided in each task to maintain clarity and consistency.
- Create a new branch directly from the GitHub issue tied to your task using
develop
branch as the source. You can copy the branch name from the issue if it is included. example: (type/###-brief-description
). - Push the branch to the remote repository.
- Open a pull request for review and approval.
- Merge the branch into
develop
after approval and testing.
Using GitHub's issue view to create branches streamlines the process of tying specific tasks to branches, enhancing traceability and organization within your version control system. Adhering to these guidelines ensures a structured approach to feature development, bug fixes, documentation updates, and other tasks across your team, with branch names following the specified format.