-
Notifications
You must be signed in to change notification settings - Fork 1
Git Workflow with Linear Integration
Jordan Janakievski edited this page Oct 30, 2023
·
6 revisions
This document outlines a Git workflow that integrates with Linear, a ticket tracking system. This workflow helps maintain consistency in branch naming, commit messages, and pull request (PR) descriptions, making it easier to link Git changes with Linear issues.
- Branch Naming:
- Obtain the branch name from the Linear issue by copying it.
- Create a new Git branch using the copied name.
git checkout -b <branch-name>
- Commit Messages:
- Use a standard format for commit messages, including the Linear issue identifier (e.g., TCES-1) and a concise description.
- Using magic words from the Pull Request section will link the commit to a Linear issue
git commit -m "Completing TCES-1 Added new files to the repository"
- Protected Branch:
- Consider marking the main branch as a protected branch to prevent direct pushes.
- Example Branches:
- Create and work on feature branches (e.g.,
tces-123-user-api
andtces-321-profile-ui
) for new features or bug fixes. - To keep your feature branch up to date with the latest changes in
main
, periodically mergemain
into your feature branch:
git checkout <feature-branch>
git merge main
See the README on how to access the Docker terminals
- Run the linter in the necessary directory or directories to check for any errors
npm run lint
- Run the formatter in the event of any failed lints for the necessary directory or directories
npm run format
- Pull Request Naming:
- Name your PRs to match your branch names. This makes it easier to link PRs with Linear issues.
- PR Description:
- Use "magic words" in the PR description to link it with Linear issues. Examples:
-
Fixes TCES-1
: This automatically closes the issue when the PR is merged. - Here is a list of all magic words:
close
,closes
,closed
,closing
,fix
,fixes
,fixed
,fixing
,resolve
,resolves
,resolved
,resolving
,complete
,completes
,completed
,completing
-
If you have any other questions, please feel free to check out the GitHub Documentation for Linear