You should use Path.fromPortableString to convert the path. Git uses portable path strings on all OSes.