Jenkins not playing nice with a private GitHub repository (Windows)

I cannot for the life of me seem to get my Jenkins CI to work with Github.

I had failure on the clone command, but that was due to keys, so I logged in as service account (the user Jenkins runs under as a Windows Service) and ran the clone command. All good in the hood.

However, when I want to run the fetch to get latest, it won't finish. It just sits there. I have tried via the Git plugin for Jenkins, and also via a Windows commandline script. Neither work. However, if I open a command prompt and type the command in, it works!

So how do I get it to work via Jenkins?

I run this script:

set
"C:\Program Files (x86)\Git\bin\git.exe" fetch -t ssh://git@github.com/OrgName/MyRepo.git +refs/heads/*:refs/remotes/origin/*
exit 0

and it sticks on the fetch command, never exiting.

Does someone have any suggestion?

Answers


It looks like msysGit stuck trying to find one of its components, used during fetch operation.

The Git itself not a single executable actually. It's a set of small tools doing their job great only being put together. Running Git on Windows from bash prompt makes it happen, but when you're running via Windows command prompt or in batch-files, the Force may not be with you.

I think you should check wherever you installed msysGit with option "Run Git from Windows Command Prompt". In this case all needed parts of Git will be added to the system PATH variable and git.exe will be able to access it from batch files, thus it should fix your fetch statement.


Need Your Help

how can i write a sql query that finds rows where one column is a substring of another column

sql tsql

I wish to find all rows in a table where one column is a substring of another column.

Iterating through objects in underscore.js templates

javascript json underscore.js underscore.js-templating

Help! This should't be so difficult, so I assume I'm missing something easy...