8

Does JGit support Git Credentials as documented here: http://git-scm.com/docs/gitcredentials?

I haven't found yet anything to this topic.

Rüdiger Herrmann
  • 20,512
  • 11
  • 62
  • 79
olibur
  • 337
  • 5
  • 13

1 Answers1

6

The counterpart to Git Credentials in JGit is the CredentialsProvider interface. All commands that establish connections to remote repositories can be configured with a CredentialsProvider instance. They inherit from TransportCommand which has a setCredentialsProvider method.

Rüdiger Herrmann
  • 20,512
  • 11
  • 62
  • 79
  • 1
    This would mean, that these part has still to be implemented because I haven't found yet any CredentialsProvider which would support to read out the credentials from these "Git credentials" stores? – olibur Apr 22 '14 at 05:47
  • 1
    Right, the Git credential cache/store is not implemented in JGit. But you should be able to implement a CredentialProvider yourself that reads from `.gitcredentials` if that is what you need. To let the JGit team know that you're interested in such a feature you may also want to file an [enhancement request](https://bugs.eclipse.org/bugs/enter_bug.cgi?product=JGit) or post to the [developer mailing list](https://dev.eclipse.org/mailman/listinfo/jgit-dev) – Rüdiger Herrmann Apr 22 '14 at 09:29
  • 5
    There's an [open bug on JGit for this](https://bugs.eclipse.org/bugs/show_bug.cgi?id=441198) but it hasn't seen a lot of action. – Elliotte Rusty Harold Jan 08 '19 at 10:18