Git push over SSH on Windows won't work
I’ve got an enigma for you guys!
- Moving directories for portable git configuration
- EGit - fetch, merge, pull troubles
- “permission denied” while removing git directory
- What git server solution to use on windows and active directory?
- Git Bash (Windows) not using PATH
- GUI Git client for Windows: SourceTree VS GitEye
- Windows 8
- msysgit, last version
- Using SSH Key authentication
- Pagent handles SSH key authentication using valid .ppk key (logon with PuTTY is OK)
- The bare repository is healthy, with permissions OK. Working with git linux client (tested on local Ubuntu VM with the same SSH key)
error: insufficient permission for adding an object to repository database ./obj
D:\path\to>git clone ssh://email@example.com/opt/git/project Cloning into 'project'... Unable to use key file "D:\path\to\puttykey.ppk" (unable to open file) remote: Counting objects: 3, done. remote: Total 3 (delta 0), reused 0 (delta 0) Receiving objects: 100% (3/3), done. Checking connectivity... done. D:\path\to>cd project ...me creating some random file... D:\path\to\project>git add test D:\path\to\project>git commit -m "Init" [master 118a94e] Init 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 test D:\path\to\project>git push origin master Unable to use key file "D:\path\to\puttykey.ppk" (unable to open file) Counting objects: 2, done. Writing objects: 100% (2/2), 293 bytes | 0 bytes/s, done. Total 2 (delta 1), reused 2 (delta 1) error: insufficient permission for adding an object to repository database ./obj fatal: failed to write object error: unpack failed: unpack-objects abnormal exit To ssh://firstname.lastname@example.org/opt/git/project ! [remote rejected] master -> master (n/a (unpacker error)) error: failed to push some refs to 'ssh://email@example.com/opt/git/project'
I’m honestly accepting any kind of help, thanks by advance..!
By the way, what the hell with this
Unable to use key file "D:\path\to\puttykey.ppk"??
One Solution collect form web for “Git push over SSH on Windows won't work”
Most of the answers, as the ones in “Error pushing to GitHub – insufficient permission for adding an object to repository database” mentions an issue around access rights in folder.
That translates into chmod… which doesn’t really apply on Windows.
But this answer mentions the same error message when your ssh url reference an entry in your
%HOME%/.ssh/config file which is for another public/private ssh key than the one you want to use.
Make sure your url uses the right entry, as I explain in “access repository with ssh”
Host aKey User git HostName yourHost Port 22 IdentityFile ~/.ssh/<firstname.lastname@example.org>.key
Here, the OP blint adds in the comments:
Unable to use key file "D:\path\to\puttykey.ppk"was therefore due to a wrong path defined in the incriminated PuTTY profile.