Jenkins git-client: how to move to jgit on windows

Since the Jenkins git-client plugin moved to use jgit, there have been a lot of issues with configuration and all of the solutions I have seen involve just switching back to using the old git command line since most installations by now have most of the hacks in place to make it work most of the time.

We are in the same boat, but the git command line is still very unreliable under Windows. We like the idea of using jgit under the hood in the new git-client, and would like to see if it actually makes things better. But I cannot find a single ounce of documentation on how to move to jgit.

  • Workflow for maintaining local repositories of remote subversion repositories
  • How to git ignore everything but one folder?
  • What does “Modify files with subversion/git” mean?
  • Versioning of debian packaging Information
  • Make a git branch equal to master again
  • With git rebase, is there a way to reword commit messages in the git-rebase-todo using the default commands?
  • FYI I already know about




    What I’m looking for is how to configure jgit for ssh, email/user info, etc.

  • Version control to coordinate with yourself
  • Automatic git submodule update in Pycharm
  • SSH troubles pushing with Git
  • How do git remotes work?
  • Selectively importing other people's pull requests in your own Github fork
  • Git: get name of files commited?
  • 2 Solutions collect form web for “Jenkins git-client: how to move to jgit on windows”

    Pending a better documentation (more complete than the user guide, and forums), I would rely on:


    You will find tons of tests, illustrating how JGit is supposed to be used.

    • Email, for instance, is read from the config file in

      authorName = localConfig.get(UserConfig.KEY).getAuthorName();
      authorEmail = localConfig.get(UserConfig.KEY).getAuthorEmail();
    • SSH, as another example, reads its config file as illustrated in

      config("Host orcz\n" + "\tHostName\n" + "\tPort 2222\n"
        + "\tUser jex\n" + "\tIdentityFile .ssh/id_jex\n"
        + "\tForwardX11 no\n");
      final Host h = osc.lookup("orcz");

    And so on…

    You also have the recent (August 2013) JGit cookbook, created by centic (Dominik Stadler)

    Grab it

    git clone git://

    Build it and create Eclipse project files

    mvn dependency:sources eclipse:eclipse package

    Run it

    Import the project into an Eclipse workspace and execute the snippets there.

    This cookbook has been updated to JGit 3.0.3.

    JGit picks up some setting from the system wide configuration file /etc/gitconfig which git installs, but only if it can find it. It will find the file if git is in PATH, but you can also set the system property jgit.gitprefix to the path of where git is installed, i.e. path to the directory above the bin directory, .e. C:\Program Files\Git

    Git Baby is a git and github fan, let's start git clone.