Team Foundation Sever GIT Setup
How to set up TFS GIT using SSH.
Creating an SSH key in RSA format
-
Log into the AIQ server.
-
Using a git-bash create a key pair by executing the following line:
ssh-keygen -m pem
-
Leave the passphrase empty.
-
Use the default name for the keypair.
-
After the process ends you should have new entries in C:\Users\<win-username>\.ssh called id-rsa and id-rsa.pub. id-rsa is the private key, and id-rsa.pub is the public key.
Upload the SSH public key to TFS
-
Open your user profile security settings in TFS and select SSH Keys.
-
Click Add.
-
Enter a name for the key and paste the contents of the id-rsa.pub file (not id-rsa).
Create a Personal Access Token (PAT)
-
Create and save to a secure place a Personal Access Token (PAT) by opening your TFS profile security setting and clicking on Personal access tokens
-
Click Add.
-
Enter the Description and Click Create Token
-
Save the Token to add it as PassPhrase in AIQ Preferences>Repository page
Cloning an AIQ repository
Using the AIQ SSH inputs as follows:
-
SSH URL provided by the TFS server
-
Paste the private key contents into the GIT SSH key
-
Enter the username used to log in to TFS as the username (like SudhaRani.appvance)
-
Enter the personal access token (PAT) for the passphrase
-
Click Clone.
Exchange method Error:
Microsoft Visual Studio Team Foundation Server git repositories use Windows Credentials manager with NTLM to authenticate its repositories via HTTPS. This is not supported by jgit which is the GIT library used by AIQ.
The way to overcome this is to use SSH authentication, but depending on the version of your TFS server you might get the following error:
no matching key exchange method was found. Their offer: diffie-hellman-group1-sha1,diffie-hellman-group14-sha1
-
The above error is because the new open-ssl.exe has dropped those SHA1 algorithms and the TFS server does not provide newer options, so the connection fails. To overcome this problem you need to create a file in the AIQ server inside the .ssh folder
-
The config file should have this line:
KexAlgorithms +diffie-hellman-group1-sha1,diffie-hellman-group14-sha1
-
Add this file into .ssh folder
-
Add GIT URL and credentials in credentials manager to access GIT files inside the machine:
Credential manager will auto pop up in case no creds are are found in the credential manager and can enter the creds from there as well.