Kinook Software Forum

Go Back   Kinook Software Forum > Visual Build Professional > [VBP] Third Party Tools

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 05-02-2015, 02:10 AM
ub3rst4r ub3rst4r is online now
Registered User
 
Join Date: 04-24-2010
Location: Calgary
Posts: 2
Getting Git to work with public key

I'm having troubles pushing to a git repository and I think it's harder than it should be. I added Git to the Visual Build project and set the command to "push" and the working directory to the directory that contains the git repository. When I go to test the step, I get the following:

Quote:
Warning: Permanently added 'github.com,192.30.252.130' (RSA) to the list of known hosts.
Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
I should also note that I added the directory containing git.exe (%USERPROFILE%\AppData\Local\GitHub\PortableGit_c2 ba306e536fdf878271f7fe636a147ff37326ad\bin) to the PATH environment variable (so git could be run from any command line). I'm using GitHub For Windows and I have no problem pushing to the repository using the Git Shell.

For whatever reason, Visual Build isn't picking up the SSH key (located in %USERPROFILE%\.ssh). I setup a new SSH key to work with Pageant but it still says "Permission denied (publickey)" (also when using git from the command line). It seems that git.exe only works (online) when its opened with the Git Shell. The only way I can see getting it to work is by using a Powershell step instead of Git. Also, if I try to SSH in with PuTTY then it works and I get the following:

Quote:
Authenticating with public key "xxxxxx@gmail.com" from agent
Server refused to allocate pty
Hi xxxxxx! You've successfully authenticated, but GitHub does not provide shell access.
I should also note I'm using the latest version of Visual Build (v8.7).

Has anyone been able to get "git push" to work with Visual Build? If so, how?
Reply With Quote
  #2  
Old 05-02-2015, 08:14 AM
kinook kinook is online now
Administrator
 
Join Date: 03-06-2001
Location: Colorado
Posts: 6,003
That output is coming from git, not Visual Build. Check the Log the command-line option on the Advanced tab of the action, rebuild the step, and compare the git command-line call that was used with the working git command.
Reply With Quote
  #3  
Old 05-02-2015, 11:08 PM
ub3rst4r ub3rst4r is online now
Registered User
 
Join Date: 04-24-2010
Location: Calgary
Posts: 2
I figured out that the problem was using Github for Windows instead of msysgit.

For future reference, I downloaded and downloaded msysgit (from https://msysgit.github.io/). When you get to the step that says "Adjusting your PATH environment", make sure that "Run Git from the Windows command prompt" is selected (if this isn't selected, Visual Build might fail because git could not be found). Then at the step that says "Choosing the SSH Executable", I selected "Use Plink". You will have to make sure Pageant is setup to work with your GitHub account (instructions for that can be found here) and Pageant will need to be running in the background in order for Git to properly authenticate with GitHub.com.
Reply With Quote
Reply

Tags
git , key , step

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



All times are GMT -5. The time now is 06:10 AM.


Copyright © 1999-2023 Kinook Software, Inc.