2015-04-17 29 views
3

我使用git-tfs与TFVC存储库一起工作。我开始研究其他项目,并将项目的代码托管在不同的服务器上。git-tfs在克隆版本库时返回“(401)未授权”错误

现在我尝试克隆存储库时遇到错误。

git tfs clone http://tfs-server:8080/tfs $/CompanyName/Dev 

它提示我输入凭证两次。然后它显示一个错误。

TF30063: You are not authorized to access http://tfs-server:8080/tfs. 
The remote server returned an error: (401) Unauthorized. 

我已经仔细检查过它是一个正确的网址。我可以通过Visual Studio和浏览器进行连接。

我已经仔细检查过它是一个正确的密码和用户名。我可以在浏览器中使用此凭据登录。

我可以从我的机器上的不同服务器克隆代码。

该服务器的Visual Studio Team Foundation Server的2013我的git-TFS版本

git-tfs version 0.21.0.0 (TFS client library 12.0.0.0 (MS)) (64-bit) 

我发现有一个类似的错误了几个问题,并试图答案。所以这些是我试图做的事情:

  • 在Visual Studio的浏览器中从此服务器注销;
  • 清理Internet Explorer缓存
  • 正在删除C:\ Users \ UserName \ AppData \ Local \ Microsoft \ Team Foundation \ 5.0 \ Cache文件夹;
  • 将tfs服务器添加到Internet Explorer中的本地Intranet安全区域。

这是调试输出:

git tfs clone http://tfs-server:8080/tfs $/CompanyName/Dev --debug 

Command run:git tfs clone http://tfs-server:8080/tfs $/CompanyName/Dev --debug 
No authors file used. 
git-tfs version 0.21.0.0 (TFS client library 12.0.0.0 (MS)) (64-bit) 
git command: Starting process: git init 
Initialized empty Git repository in C:/Users/UserName/Dev/.git/ 
git command time: [00:00:00.0660000] init 
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> Microsoft.TeamFoundation.TeamFoundationServerUnauthorizedException: TF30063: You are not authorized to access http://tfs-server:8080/tfs. ---> System.Net.WebException: The remote server returned an error: (401) Unauthorized. 
    at System.Net.HttpWebRequest.GetResponse() 
    at Microsoft.TeamFoundation.Client.Channels.TfsHttpWebRequest.SendRequestAndGetResponse(HttpWebRequest webRequest, WebException& webException) 
    --- End of inner exception stack trace --- 
    at Microsoft.TeamFoundation.Client.Channels.TfsHttpWebRequest.ReadResponse(HttpWebResponse webResponse, WebException webException) 
    at Microsoft.TeamFoundation.Client.Channels.TfsHttpWebRequest.SendRequest() 
    at Microsoft.TeamFoundation.Client.Channels.TfsHttpRequestChannel.Request(TfsMessage message, TimeSpan timeout) 
    at Microsoft.TeamFoundation.Client.Channels.TfsHttpClientBase.Invoke(TfsClientOperation operation, Object[] parameters, TimeSpan timeout, Object[]& outputs) 
    at Microsoft.TeamFoundation.Framework.Client.RegistrationProxy.GetRegistrationEntries(String toolId) 
    at Microsoft.TeamFoundation.Framework.Client.RegistrationService.GetInstanceId() 
    at Microsoft.TeamFoundation.Framework.Client.RegistrationService.get_InstanceClientCacheDirectory() 
    at Microsoft.TeamFoundation.Framework.Client.RegistrationService..ctor(TfsTeamProjectCollection tfsObject) 
    at Microsoft.TeamFoundation.Client.TfsTeamProjectCollection.CreateServiceProxy(Type serviceType) 
    at Microsoft.TeamFoundation.Client.TfsConnection.GetService(Type serviceType) 
    at Microsoft.TeamFoundation.Framework.Client.PreFrameworkServerDataProvider.FindServiceLocation(String serviceType, String toolId) 
    at Microsoft.TeamFoundation.Framework.Client.PreFrameworkServerDataProvider.LocationForCurrentConnection(String serviceType, Guid serviceIdentifier) 
    at Microsoft.TeamFoundation.Client.TfsConnection.EnsureProviderConnected() 
    at Microsoft.TeamFoundation.Client.TfsConnection.EnsureAuthenticated() 
    at Sep.Git.Tfs.VsCommon.TfsHelperBase.EnsureAuthenticated() 
    at Sep.Git.Tfs.Core.GitTfsRemote.EnsureTfsAuthenticated() 
    at Sep.Git.Tfs.Core.GitRepository.CreateTfsRemote(RemoteInfo remote, String autocrlf, String ignorecase) 
    at Sep.Git.Tfs.Commands.Init.Run(String tfsUrl, String tfsRepositoryPath) 
    at Sep.Git.Tfs.Commands.Clone.Run(String tfsUrl, String tfsRepositoryPath, String gitRepositoryPath) 
    --- End of inner exception stack trace --- 
    at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) 
    at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments) 
    at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) 
    at Sep.Git.Tfs.Util.GitTfsCommandRunner.Run(GitTfsCommand command, IList`1 args) 
    at Sep.Git.Tfs.GitTfs.Main(GitTfsCommand command, IList`1 unparsedArgs) 
    at Sep.Git.Tfs.Program.Main(String[] args) 
TF30063: You are not authorized to access http://tfs-server:8080/tfs. 
The remote server returned an error: (401) Unauthorized. 

我能做些什么让我的git-TFS流回来?

回答

2

我已经将集合名称添加到服务器的网址,它工作。

正确的命令是:

git tfs clone http://tfs-server:8080/tfs/collectionName $/CompanyName/Dev 

虽然在问题的命令工作了以前的服务器。

+0

嗨,那里,当你引用'CollectionName'在哪里可以找到这个完全?我有同样的问题:(谢谢 – theiOSDude

+0

这是团队项目集合。如果你有网络访问,你可以在重定向后的/ tfs/part之后在url中找到。 – filhit

+0

@ burrows111它也在Connect的左栏到Team Foundation Server窗口([截图](http://content.screencast.com/users/filhit/folders/Jing/media/b337d520-3a41-4078-bc95-ccfeac74cbc4/2015-07-10_0855.png)) – filhit

相关问题