>PROBLEM
Attempt to a Git operation over remote repository returns the following message:
Could not create directory 'your path here' (No such file or directory).
Failed to add the host to the list of known hosts (/your local path here/known_hosts).
See picture where it points to "issue".
>SOLUTION#1
Set the envvar GIT_SSH.
GIT_SSH=$YOUR_PATH/.ssh/known_hosts
If linux, use export cmd.
If Windows, use sysdm.cpl, Advanced tab, Environment Variables.
Reopen the console and check:
echo %GIT_SSH%
If linux, use export cmd.
If Windows, use sysdm.cpl, Advanced tab, Environment Variables.
Reopen the console and check:
echo %GIT_SSH%
>SOLUTION#2
1. Open Git Bash console.
2. Perform the command below to enable read and write;
chmod 776 your local path here/known_hosts
3. Keep the git bash console opened, test running a git command again.
For instance:
git ls-remote
The problem is gone as the figure shows where it points to "solved".
>ENV
Windows 10
[REF]: faq-Failed to add the host to the list of known hosts
No comments:
Post a Comment