Curl Initialization error with git pre-push hook
I created a git pre-push hook to check the commits being pushed.
One of the validation steps fetches some data using cURL for validating the commit. On running git push, cURL fails to initialize with error
curl: (2) Failed initialization
The pre-push hook has the correct permissions (-rwx——). To narrow down the problem I removed everything from the script except the cURL command and I am able to reproduce the error with a very simple script
- Command Prompt Directory Styling
- git edit authors name in commit range, script
- Git Squash commits from mysqldump
- How to disable git aware zsh theme on folders that dont have a .git/
- Git post-receive hook fails to run worktree
- How do I get bash autocomplete to work with git aliases that use shell commands?
#!/bin/sh /usr/bin/curl "http://www.google.com"
The script works as expected when run standalone.
i. Git already added to path
ii. Curl version: curl 7.24.0 (x86_64-redhat-linux-gnu)
I would really appreciate any help on this.
One Solution collect form web for “Curl Initialization error with git pre-push hook”
curl is using with
ldd /usr/bin/curl, as in this answer
As seen in this issue, you might then need to adjust
LD_LIBRARY_PATH to reference what library is actually used.