When using a git repository hook, how can I use SmartGit's internal SSH client?

When using a hook with a scp operation, I receive a Permission Denied: (publickey) error.

SmartGit is aware of the credentials, they are listed under Edit > Preferences > Commands > Authentication, when pulling from the repository.

I require a commit-msg hook to generate Change-Id: tags in commit messages which is required for proper gerrit functioning (setup using the Mahara developer contribution guide):

#!/bin/sh
scp -p -P 29418 username@reviews.mahara.org:hooks/commit-msg .git/hooks/
有帮助吗?

解决方案

This is not possible. When SmartGit invokes the Git binaries, it sets GIT_SSH environment variable to its internal client only for certain commands, like push and pull, but not for commit. So you will have to configure your SSH client manually, if you really think you will need a connection to the remote repository on commit (what IMHO shouldn't be necessary).

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top