I’ve been using git along with a project in order to have version control for quite some time now. But all of a sudden, it stopped working! I noticed that while pushing new changes, because I received this message:
/home/user/bin/git/bin/git: No such file or directory
Also, whereis command is unable to find where the program named git is present:
> whereis git
git:
Any idea on how I can solve this?
I’m using vs code on Windows 10, but I’m using gitbash as my integrated terminal instead of the Windows shell.
When using either the «Open in Integrated Terminal» or «Open Root in Integrated Terminal» commands, the directory is not found because the directory slashes are backslashes (Windows-style) instead of forward slashes (bash-style)
Upon opening the terminal, the following output is shown:
cd c:UsersStevenDevselenium.js
bash: cd: c:UsersStevenDevselenium.js: No such file or directory
If I type manually type «cd c:/Users/Steven/Dev/selenium.js» in the integrated terminal, then the cd command works.
I am running a very simple script to pull multiple repositories stored in a text file. This was running fine before updating Git. Now I get a ‘No such file or directory’ error for each repository. If I hardcode the directory into the script it runs fine.
Here is the script:
filename="../Repositories/all.txt"
echo "Starting list"
printf "n"
filelines=`cat $filename`
for line in $filelines ; do
if
[[ $line != !* ]];
then
printf "n"
echo $line
repopath=${line:19}
echo $repopath
fullpath=/c/DevSource/Tamu/GeoInnovation/$repopath
echo $fullpath
#cd /c/DevSource/Tamu/GeoInnovation/AddressProcessing.Core
cd $fullpath
git pull
fi
done
Here is the output when running bash -x pullallrepos.sh
+ for line in '$filelines'
!= !* ]].GeoInnovation.AddressProcessing.Core
+ printf 'n'
+ echo $'Tamu.GeoInnovation.AddressProcessing.Corer'
Tamu.GeoInnovation.AddressProcessing.Core
+ repopath=$'AddressProcessing.Corer'
+ echo $'AddressProcessing.Corer'
AddressProcessing.Core
+ fullpath=$'/c/DevSource/Tamu/GeoInnovation/AddressProcessing.Corer'
+ echo $'/c/DevSource/Tamu/GeoInnovation/AddressProcessing.Corer'
/c/DevSource/Tamu/GeoInnovation/AddressProcessing.Core
+ cd $'/c/DevSource/Tamu/GeoInnovation/AddressProcessing.Corer'
: No such file or directoryd: /c/DevSource/Tamu/GeoInnovation/AddressProcessing.Core
+ git pull
Updating 4ad72a9..0c00ac0
If I hardcode the path here:
cd /c/DevSource/Tamu/GeoInnovation/AddressProcessing.Core
#cd $fullpath
It runs fine:
+ echo $'Tamu.GeoInnovation.AddressProcessing.Corer'
Tamu.GeoInnovation.AddressProcessing.Core
+ repopath=$'AddressProcessing.Corer'
+ echo $'AddressProcessing.Corer'
AddressProcessing.Core
+ fullpath=$'/c/DevSource/Tamu/GeoInnovation/AddressProcessing.Corer'
+ echo $'/c/DevSource/Tamu/GeoInnovation/AddressProcessing.Corer'
/c/DevSource/Tamu/GeoInnovation/AddressProcessing.Core
+ cd /c/DevSource/Tamu/GeoInnovation/AddressProcessing.Core
+ git pull
Already up-to-date.
I feel like I am missing something really simple but for the life of me I can’t find it.
Только начала разбираться в GIT.
Установила на винду, ввела user name и mail. Попробовала команду git init , выдает ошибку «No such file or directory». Попробовала команду git clone, тоже выдает ошибку (на втором скрине)
Подскажите, пожалуйста, простыми терминами , что я делаю не так или скиньте статейку, где написано про то, как решить данную проблему.
Ekaterina
07.12.2020, 08:42
Александр, здравствуйте!
Подскажите, пожалуйста, мне не удается склонировать проект.
Постоянно выходит ошибка: No such file or directory.
Ключи SSH я сформировала, прописала на GitHub, сохранила.
Далее, при вводе команды: git@github.com: имя проекта
выходит сообщение: bash: git@github.com: имя проекта.git: No such file or directory
На всех возможных ресурсах ищу ответ, исправить не удается.
Как исправить ошибку?
Ekaterina
07.12.2020, 09:16
Также, погуглила и по одной рекомендации, проверила соединение с GitHub через команду: ssh -T git@github.com
Выходит вот что: The authenticity of host ‘github.com (……)’ can’t be established.
RSA key fingerprint is SHA256: номер ключа.
Are you sure you want to continue connecting (yes/no/[fingerprint])?
Александр Мальцев
06.10.2016, 12:59
1. Необходимо создать идентификационный ключ RSA (по умолчанию он помещается в файл id_rsa.pub):
ssh-keygen -t rsa
2. Открыть в браузере страницу _https://github.com/settings/ssh. Нажать в ней на кнопку New SSH key. В открывшейся форме ввести имя и ключ из файла id_rsa.pub.
3. Выполнить клонирования репозитория.