0

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
Saudrules
  • 1
  • 1

1 Answers1

0

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.

Kevin Lu-MSFT
  • 20,786
  • 3
  • 19
  • 28
  • 1
    Thanks a lot! but as far as I know, Git-tfs doesn't work on MacOS (https://github.com/git-tfs/git-tfs/issues/758) and that's why I went for git-tf. – Saudrules Aug 31 '20 at 12:56
  • I have tried to install java 7 and added it to the $PATH and also set $JAVA_HOME with /Library/Java/JavaVirtualMachines/jdk1.7.0_80.jdk/Contents/Home/ but still, the same error occurs. – Saudrules Aug 31 '20 at 13:52
  • Thanks for your information. After installing the Java, have you tried to restart the machine? If this issue still exists, could you please try other git-tf commands (git-tf configure)? You could check if other commands have the same issue. – Kevin Lu-MSFT Sep 01 '20 at 09:02