git-tf clone exception java.lang.UnsatisfiedLinkError

288 views Asked by At

I am trying to use git-tf to clone a TFVC project on TFS. When I run git-tf clone I am prompted to enter my TFS username and after entering my username, I get a java.lang.UnsatisfiedLinkError. My goal is to migrate this project to Git and push it to Gitlab while maintaining the changeset history of course.

Command: git-tf clone https://tfs-url/tfs/defaultcollection/ $/TFSProjectName ~/Desktop/MyTFSProject --deep

Full Exception:

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)

Environment:

  • OS: MacOS Catalina 10.15.5
  • Java: openjdk 11.0.7 2020-04-14
  • Git-tf: git-tf version 2.0.3.20131219
1

There are 1 answers

3
Kevin Lu-MSFT On

From the error message, the cause of this issue is the java version.

Check this doc about Git-TF. You could download the Java 7 and set it as the PATH environment variable.

Test with Java 8 and it could also work.

On the other hand, Git-TF has reached its end-of-life.

My goal is to migrate this project to Git and push it to Gitlab while maintaining the changeset history of course.

I recommend you to use Git-tfs to achieve it.

Here are the script:

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

In this case, the TFVC Repo could be changed as Git repo. Then you could use git push to push the Repo to Gitlab.

It will keep the history too.