Smart Commits in YouTrack
How to Make Smart Commits in YouTrack
YouTrack supports smart commits that allow you to apply commands to issues right from your commit messages.
Step 1: Enable Commit Command Integration (For PMs/ Techleads)
In order to use smart commits, you need to enable the ‘commit command integration’ in YouTrack. You can do this by going to ‘Administration > Integrations > VCS Hosting Services’ and configure the necessary settings for your repository.
Step 2: Committing Changes with Commands
The general format of a smart commit in YouTrack is:
<issue-id> <commit message> <command>
Where:
- issue-id is the identifier of the issue you’re working on
- commit message is a brief description of the changes you’ve made
- command is the command to execute. This could be something like Fixed, Implemented, or In Progress.
Example:
git commit -m "#YT-123 Fixed bug in login page Fixed
In this example, #YT-123 is the issue id, Fixed bug in login page is the commit message, and Fixed is the YouTrack command that changes the state of the issue to ‘Fixed’.
Step 3: Pushing Changes to the Repository
After making a commit, push it to the repository:
git push origin <your-branch-name>
How to View Commit Commands in YouTrack
You can view the commit commands applied to an issue in YouTrack in the following way:
https://www.jetbrains.com/help/youtrack/server/VCS-Changes.html
Go to the full page view of the issue by clicking on the issue id from the issue list.
Scroll to the ‘VCS Changes’ section. Here, you will see a list of commits linked to the issue.
Click on a commit to view its details, including the commit message and the command that was applied.
Remember that for the commit to appear in YouTrack, the commit command integration must be correctly set up and the repository must be linked to YouTrack.
Please refer to the official YouTrack documentation for more details and updates beyond this guide: https://www.jetbrains.com/help/youtrack/standalone/Commit-Command-Integration.html
Troubleshooting
Issue: VCS Tab Not Visible
If you’re using YouTrack Lite, you might encounter an issue where the VCS (Version Control System) tab is not visible in the user interface.
Cause: YouTrack Lite is a streamlined version of YouTrack that simplifies the user interface by removing some of the more advanced features, including the VCS integration. This means that the VCS tab, which is used to configure and manage VCS integrations, is not available in YouTrack Lite.
Solution: If you need to use VCS integration features, such as smart commits, you will need to switch to YouTrack Classic. You can do this by clicking on your profile avatar in the lower-left corner of the screen, and then selecting the ‘Switch to YouTrack Classic’ option. Once you’re in YouTrack Classic, you should be able to see the VCS tab and configure VCS integrations as described in this guide.
Please note that switching to YouTrack Classic will change the user interface and may enable additional features that are not available in YouTrack Lite. If you’re not familiar with YouTrack Classic, you might need to spend some time learning how to navigate the interface and use the additional features.