I want to import TFS repo to git and clone into my local machine and I am using git-tf. Below my code:- git-tf clone http://server:8080/tfs/DefaultCollection $/SampleProject D:\TFSRepoName I want to pass username and password in url , so it automatic clone repo without asking for username and password.
If you don't want to be prompted for credentials every time you run git-tf
, you can store your credentials in your GIT configuration for your repository:
$ git config --global git-tf.server.username your-username
$ git config --global git-tf.server.password your-password
Note that your password will be stored in the git configuration file in plain text. Be sure to set the ACLs or file permissions as appropriate to discourage people from reading your password out of your configuration file. Or you can store just the username and you will need to type only your password each time.
Reference : Accessing TFS with git-tf
You can also try to install and Use the Git Credential Manager,
When you connect to a Git repository from your Git client for the first time, the credential manager will prompt for your credentials. Once authenticated, the credential manager will create and cache a personal access token for future connections to the repo. Git commands that connect to this account will not prompt for user credentials until the token expires or is revoked through VSTS/TFS.