Connect to a VCS
YouTrack lets you link your project to a version control system. YouTrack supports direct integration with GitHub, GitLab and Bitbucket.
Connections to other version control systems are supported by the Upsource and TeamCity integrations.
- Upsource supports connections to repositories in Git, Mercurial, Perforce, and Subversion.
- TeamCity supports connections to repositories in ClearCase, CVS, Git, Mercurial, Perforce, SourceGear Vault, StarTeam, Subversion, Team Foundation Server, and Visual SourceSafe.
You can enable the same features that are described here when an administrator connects your VCS to Upsource or TeamCity and enables the corresponding integration in YouTrack. For more information, see Upsource Integration and TeamCity Integration.
When connect your project to a version control system, the following features are enabled:
- Reference an issue ID in the comments when you commit updates to the code repository.
The VCS integration adds a direct link to the YouTrack issue in the change details.
The comment is automatically added to the list of changes on the VCS Changes tab in the YouTrack full page view. Each VCS change includes a direct link to the change details in the code repository. For more information, see Link Issues in VCS Commits. - Enter commands in the comments for your commits and pull requests in the VCS. When you push the commit, the command is applied all of the issues that are referenced in the comment. You can use this feature to update the status or add comments to one or more issues without even opening YouTrack. For more information, see Apply Commands in VCS Commits.
- (GitHub only) Add links to the repository by pasting commit hashes into the summary, description, comment, or string-type custom field in YouTrack issues.
The tab in the project profile lists all of the repositories that are connected to your YouTrack project.
The general procedure for integrating a VCS consists of the following steps:
- Connect to a repository. This procedure is different for each repository type.
- Map the repository to your project.
Prerequisites
- Your YouTrack server must be accessible from the Internet.
- A committer's email address in YouTrack must be the same as in the linked repository. YouTrack searches for a user account based on the email address that is registered in the VCS. These users must also have permission to update issues in the connected YouTrack project. If no match is found or the user does not have the required permission, the commands are not applied.
Connect to a Repository
The first step is to connect to the VCS repository.
To connect to the VCS repository:
To connect to a GitHub repository:
- Generate an OAuth token in GitHub:
- Paste the token in the OAuth Token field.
- If you are not the repository owner, provide the repository owner name. If you are the owner of the repository, leave the field blank.
- Click the Connect to VCS server button.
- Follow the instructions below to map the repository to your project.
To connect to a GitLab repository:
- Generate a private token in GitLab:
- Paste the token in the Private Token field.
- If you are not the repository owner, provide the repository owner name. If you are the owner of the repository, leave the field blank.
- Click the Connect to VCS server button.
- Follow the instructions below to map the repository to your project.
To connect to a Bitbucket repository:
- Enter the login and password for the Bitbucket account.
- If you are not the repository owner, provide the repository owner name. If you are the owner of the repository, leave the field blank.
- Click the Connect to VCS server button.
- Follow the instructions to map the repository to your project.
Map the Repository to Your Project
Once you have connected the VCS server, map the repository to your project.
To map the repository:
- Enter values for the settings in the New VCS Integration dialog.
- Click the Save button.