When attempting to Fetch from within IntelliJ or Clone using Check out from Version Control > Git I get this error:
Fetch failed
Could not create directory '/c/MyCompany/web-app/%HOMEDRIVE%%HOMEPATH%/.ssh'.
fatal: Could not read from remote repository.
In the Version Control console, the error reads:
Could not create directory '/c/MyCompany/web-app/%HOMEDRIVE%%HOMEPATH%/.ssh'. percent_expand: unknown key %H
fatal: Could not read from remote repository.
Please make sure you have the correct access rights and the repository exists.
I'm not sure why it's attempting to create any directory at all when Fetching, and I'm not sure why it's using my %HOME% path.
In the "Clone Repository" window, when attempting to Clone using Version Control, the Test is failing with "Repository test has failed".
When I use the GitBash to Fetch/Clone it works fine, but I want to use the tools in IntelliJ for easier use.
In the Version Control settings in IntelliJ I have SSH set to Native and IntelliJ is recognizing the Git executable.
It's possible it may have something to do with my .bashrc file which I created because I was previously getting an "Invalid public key" error using this fix: https://stackoverflow.com/a/26130250/5693073
My .bashrc file reads:
SSH_ENV=/c/Users/username/.ssh/environment
#start the ssh-agent
function start_agent {
echo "Initializing new SSH agent..."
# spawn ssh-agent
/usr/bin/ssh-agent | sed 's/^echo/#echo/' > "${SSH_ENV}"
echo succeeded
chmod 600 "${SSH_ENV}"
. "${SSH_ENV}" > /dev/null
/usr/bin/ssh-add
}
if [ -f "${SSH_ENV}" ]; then
. "${SSH_ENV}" > /dev/null
ps -ef | grep ${SSH_AGENT_PID} | grep ssh-agent$ > /dev/null || {
start_agent;
}
else
start_agent;
fi
One more thing to mention, when I check out an existing file using "Version Control: Log", the code checks out fine without any issues.
Any help is greatly appreciated, thank you!