git-tf克隆异常java.lang.UnsatisfiedLinkError

问题描述

我正在尝试使用git-tf在TFS上克隆TFVC项目。当我运行git-tf clone时,系统提示我输入TFS用户名,输入用户名后,我得到一个java.lang.UnsatisfiedLinkError。 我的目标是将这个项目迁移到Git并将其推送到Gitlab,同时当然还要保持变更集的历史。

命令: git-tf克隆https:// tfs-url / tfs / defaultcollection / $ / TFSProjectName〜/ Desktop / MyTFSProject --deep

完全例外:

Exception in thread "main" java.lang.UnsatisfiedLinkError: 'boolean com.microsoft.tfs.jni.internal.console.NativeConsole.nativeEnableEcho()'
    at com.microsoft.tfs.jni.internal.console.NativeConsole.nativeEnableEcho(Native Method)
    at com.microsoft.tfs.jni.internal.console.NativeConsole.enableEcho(NativeConsole.java:56)
    at com.microsoft.tfs.jni.ConsoleUtils.enableEcho(ConsoleUtils.java:47)
    at com.microsoft.gittf.client.clc.commands.framework.Command.prompt(Command.java:510)
    at com.microsoft.gittf.client.clc.commands.framework.Command.promptForPassword(Command.java:482)
    at com.microsoft.gittf.client.clc.commands.framework.Command.promptForCredentials(Command.java:470)
    at com.microsoft.gittf.client.clc.commands.framework.Command.getDefaultCredentials(Command.java:309)
    at com.microsoft.gittf.client.clc.commands.framework.Command.getCredentials(Command.java:335)
    at com.microsoft.gittf.client.clc.commands.framework.Command.getConnection(Command.java:370)
    at com.microsoft.gittf.client.clc.commands.CloneCommand.run(CloneCommand.java:203)
    at com.microsoft.gittf.client.clc.Main.main(Main.java:328)

环境:

  • 操作系统:MacOS Catalina 10.15.5
  • Java :openjdk 11.0.7 2020-04-14
  • Git-tf :git-tf版本2.0.3.20131219

解决方法

根据错误消息,此问题的原因是Java版本。

查看有关Git-TF的文档。您可以下载 Java 7 并将其设置为 PATH环境变量

使用Java 8进行测试,它也可以工作。

另一方面,Git-TF已达到使用寿命。

我的目标是将该项目迁移到Git并将其推送到Gitlab,同时 保持课程变更历史。

我建议您使用Git-tfs来实现。

以下是脚本:

git tfs clone <TFS URL> $/project

cd repo path

git checkout -b TempBranch 

git remote add origin <Git URL>

git push --set-upstream origin TempBranch

在这种情况下,TFVC存储库可以更改为Git存储库。然后,您可以使用git push将存储库推送到Gitlab。

它将保留历史记录。