Git (JetBrains)
Last modified: 20 April 2023This page contains description of the fields and options available when setting up VCS roots using the Git Version Control System. The VCS is visible as "Git (JetBrains)" in VCS chooser to eliminate confusion with third-party plugin.
tip
Note, that Remote run is supported in IntelliJ IDEA and Eclipse plugins, pre-tested commit is not yet supported in any of the IDE plugins.
General Settings
Option | Description |
---|---|
Fetch URL | Specify here the URL address of your remote Git repository. |
Push URL | Specify the URL of the target remote Git repository. |
Branch name | Specify the name of the working branch, or left this field blank to use "master" branch. |
Clone repository to | Provide path to a directory on TeamCity server where a bare cloned repository should be created. Leave blank to use default path. |
User Name Style | Changing user name style will affect only newly collected changes. Old changes will continue to be stored with the style that was active at the time of collecting changes. |
Submodules | Select whether you want to ignore the submodules, or treat them as a part of the source tree. |
The following protocols are supported for the server-side VCS Checkout Mode:
ssh: (e.g. git@git.somwhere.org:repos/test.git, ssh://git@git.somwhere.org/repos/test.git)
git: (e.g. git://git.kernel.org/pub/scm/git/git.git)
http: (e.g. http://git.somewhere.org/projects/test.git)
file: (e.g. file:///c:/projects/myproject/.git)
sftp: (not tested)
amazon-s3: (not tested)
Authentication Settings
Authentication Method | Description |
---|---|
Anonymous | Select this option to clone a repository with anonymous read access. (supported only for server-side checkout) |
Default Private Key | Valid only for SSH protocol and applicable to both fetch and push urls. Uses mapping specified in |
Password | Specify username and password to be used to clone the repository. (supported only for server-side checkout) |
Private Key | Valid only for SSH protocol and applicable to both fetch and push urls. (supported only for server-side checkout) |
Agent Settings
Please note that agent-side checkout has limited support for SSH. The only supported authentication method is "Default Private Key".
If you plan to use VCS Checkout Mode, you need to have Git 1.6.4.0 (or higher) installed on all the agents that you plan to use agent-side Git checkout on.
Supported default installation locations:
Windows (git.exe)
C:\Program Files\Git\bin
C:\Program Files (x86)\Git\bin
C:\cygwin\bin
Unix (git)
/usr/local/bin
/usr/bin
/opt/local/bin
/opt/bin
Option | Description |
---|---|
Path to git | Provide path to a git executable to be used on agent. If the path is not specified, TeamCity will use the location set up in TEAMCITY_GIT_PATH environment variable in system PATH. If this variable is not specified, a heuristic is used to detect git at the default locations. |
Clean Policy | Specify here when "git clean" command is run on agent, and which files should be removed. |
System Properties
For Git VCS it is possible to configure the following system properties:
Property | Default | Description |
---|---|---|
teamcity.git.clone.timeout | 18000 | Timeout in seconds for transport that is used when the branch were never fetched |
teamcity.git.fetch.timeout | 1800 | Timeout in seconds for transport that is used when the branch were previously fetched |
teamcity.git.fetch.separate.process | false | Run git fetch in separate process or not, by default it is ran in the server's process |
teamcity.git.commit.debug.info | false | Log additional debug info on each found commit |
Known Issues
Tagging is not supported over HTTP protocol
For SSH to work you should have correctly configured
$HOME\.ssh
-* Specify references to the keys in appropriate host sections (keys with passphrases do not work yet)You will need to specify "StrictHostKeyChecking" to "no" if you do not want for ssh to fail when connecting new hosts.
The file could be used to specify host aliases
java.lang.OutOfMemoryError while fetch repository. Usually happens when there are big files in repository. Currently jgit library loads file contents into the memory. To run fetch in separate process use property teamcity.git.fetch.separate.process.
Git commits are sorted by their commiter times, not their child-parent relationships. This can cause incorrect order of commits and clean checkouts on agents (e.g. TW-13846). The current workaround is to synchronize time on a machines which push to repository tracked by TeamCity.
Development Links
Git support is implemented as an open-source plugin. Refer to the Git for development links.
Thanks for your feedback!