no such file or directory что делать git
Git no such file or directory
I’m building an application and as always I’m using Git for version control.
Below are the inputs and outputs, hope you can help me:
How can I fix this?
3 Answers 3
OK that happened to me and it turns out that the new windows «controlled folder» protection feature is blocking git. adding git to the allowed apps list solved the problem.
Pathname too long problem
Given that the OP has already tried removing and re-adding the file without success, it is possible that the crux of the problem is that the complete path of Con.php has hit the 260 character limit in windows. However, when I tried to reproduce this problem, the error message clearly said fatal: unable to stat ‘very/long/path/name’: Filename too long so am not certain that that is the problem.
To check if this is the problem, switch to the directory containing Con.php and execute the following:
That should give you a count of the number of characters in the windows path of the current directory. If the count is not >=260 then this is not the problem and I would recommend moving on to Debugging other issues section below. However, if the count is >= 260, then proceed as follows:
and then try adding the file again.
See this in action below, which creates a path with >260 characters and the sets the above option to prove that it fixes the problem.
Why is this configuration not the default?
If you were wondering about that, read this:
Windows does not properly support files and directories longer than 260 characters. This applies to Windows Explorer, cmd.exe and many other applications (including many IDEs as well as bash, perl and tcl that come with Git for Windows).
and note this caveat:
Scripted git commands may still fail with this option, so use at your own risk
фатальный: не удалось прочитать имя пользователя для https://github.com: нет такого файла или каталога
Когда я пытаюсь извлечь код с помощью git Bash в Windows, у меня возникает следующая проблема:
Я уже пытался реализовать принятое решение, представленное здесь:
. но проблема не устранена. После добавления / удаления происхождения я все еще получаю ту же ошибку.
Я столкнулся с той же проблемой. Эта проблема возникла, когда я клонировал с использованием URL-адреса HTTPS, а затем попытался отправить изменения с помощью Git Bash в Windows, используя:
Однако, когда я использовал URL-адрес SSH для клонирования, этой проблемы не возникло:
Для меня ничего не git pull получилось из предложенного выше, я использую сценарий оболочки jenkins, и, по-видимому, он принимает неправильное имя пользователя. Я потратил много времени, прежде чем нашел способ исправить это без перехода на SSH.
Теперь git всегда будет использовать эти учетные данные, несмотря ни на что. Надеюсь, это кому-то поможет, вроде помогло мне.
Обратите внимание: если вместо этого вы получаете эту ошибку:
Затем вам нужно обновить Git до версии 2.16 или более поздней.
Я нашел здесь свой ответ :
/.gitconfig и добавьте следующее:
Если вы хотите продолжить, используйте https вместо ssh и не вводите свое имя пользователя и пароль из соображений безопасности.
У меня это работает!
Эта ошибка также может возникнуть при попытке клонировать недопустимый URL-адрес HTTP. Например, это ошибка, которую я получил при попытке клонировать URL-адрес GitHub, в котором было несколько символов:
На самом деле это произошло внутри Emacs, поэтому ошибка в Emacs выглядела так:
Поэтому вместо полезной ошибки о том, что такого репо по этому URL-адресу нет, он дал мне это, отправив меня в погоню за дикими гусями, пока я, наконец, не понял, что URL-адрес неверен.
Это с git версии 2.7.4.
Я публикую это здесь, потому что это случилось со мной месяц назад и снова только сейчас, снова отправляя меня в ту же погоню за дикими гусями. > 🙁
Короткий ответ:
Игнорируйте первые три строки, если это не новый репозиторий.
Более подробное описание:
У меня была такая же проблема, поскольку ни один из приведенных выше ответов мне не помог, я решил опубликовать это решение, которое сработало для меня.
Надеюсь, это поможет всем, у кого такая же проблема.
В более новой версии Git Bash появляется окно диспетчера учетных данных, и вы можете ввести свое имя пользователя и пароль, и оно работает!
Это проблема с вашими учетными данными, хранящимися в системном кеше учетных данных. Вероятно, у вас есть конфигурационная переменная credential.helper, установленная на wincred или winstore, и ее не удается очистить. Если вы запустите панель управления и запустите апплет Credential Manager, найдите элементы в разделе общих учетных данных с надписью «git: https://github.com ». Если вы удалите их, в следующий раз они будут созданы заново, но вспомогательная утилита учетных данных запросит у вас новые учетные данные.
Замените удаленный URL следующим образом:
Я столкнулся с той же проблемой, но в Linux, и я нашел проблему. У меня нет сохраненных учетных данных, поэтому я всегда ввожу их по запросу:
Как git обрабатывает http (s) соединения, /usr/lib/git-core/git-remote-https вы можете увидеть здесь:
Поэтому я попытался назвать это напрямую:
И вот оно пришло ко мне:
git-remote-https пытается прочитать учетные данные через, /dev/tty поэтому я проверил, работает ли это:
Но в другом терминале:
Comments
Morfego commented Oct 15, 2017 •
Hi folks, im having a little trouble with pushing. I’ve created new branch, as always form bickbucket, and when I was working on it I had internet problems (I was offline at that time). So I’ve commited some of my changes and couldn’t push it to bickbucket. Then I’ve made a second local commit and my internet started working again so I’ve wanted to push my changes to server. Unluckly I had error:
I’ve fetched all before trying again still I doesn’t work. Thanks for help and cheers.
The text was updated successfully, but these errors were encountered:
technoweenie commented Oct 16, 2017
Morfego commented Oct 16, 2017
Just by ctrl + G, «git lfs install». But i have problems with it. Like for example after my mate upload his stuff to master i have to open git bash and type «git lfs fetch» to download those files. I dont know if its connected to this problem tho. Should I reinstal LFS in some specific way?
technoweenie commented Oct 16, 2017
Yes, that sounds like something isn’t set up correctly. You can confirm by checking your git config:
Morfego commented Oct 17, 2017
technoweenie commented Oct 17, 2017
Ok, you’re seeing the config values multiple times since they’re declared at different configuration levels. For Git, the 3 main ones are:
technoweenie commented Oct 17, 2017
I saw something similar at desktop/desktop#3067. I think my colleague shiftkey has the answer: desktop/desktop#3067 (comment)
Under the section «WHY WON’T GIT HOOKS WORK ON WINDOWS?», we have this section:
Fix it by providing the path to the sh executable on your system.
As a workaround, these scripts can directly reference your Git installation, like so:
Morfego commented Oct 17, 2017 •
Here is my PrePush, I don’t know if its either empty or i dont have program to open it. So I need to type path to sh.exe in PrePush, right?
Btw. thanks for solving my side problem with lfs pull 🙂
Cheers.
technoweenie commented Oct 17, 2017
There’s nothing in that file. It should be a small text file that you can open in any text editor. The weird thing is the file takes up 270 bytes, so something is in there. hexdump just shows a lot of blank space in it:
For example, here’s the standard hook that LFS installs:
Unable to push: cannot run undefined: No such file or directory #1215
Comments
despairblue commented Oct 13, 2017
Prerequisites
Description
I’m trying to push to a repository using the status bar widget.
Steps to Reproduce
It also does not work if their are not remote changes.
Expected behavior:
Pushing to the repository.
Actual behavior:
After enabling git diagnostics:
Reproduces how often:
Versions
Mac OS X 10.12.6 (16G29)
The text was updated successfully, but these errors were encountered:
rsese commented Oct 13, 2017
Thanks for the report! Just to confirm, you have no problem pushing on the command line for that repository? Also, the problem is the same for you no matter what repository you use?
And lastly, if you’ve used previous versions of Atom and the GitHub package, did you always have this problem or did it just happen for you with 1.21.0?
despairblue commented Oct 16, 2017
@rsese Pushing from the terminal works. This happens with every repository, just tried a couple hosted on bitbucket and github.
I’m running Atom in dev mode because I patched the command palette to mitigate performance issues I have: atom/command-palette#90 atom/command-palette#81
I guess I just install the patched version as a regular package and disable the one that is shipped.
Not sure if this still is a bug though, is there a reason the github package should not work in dev mode?
Проблема с настройкой git с моей учетной записью GitHub ошибка: не удалось заблокировать файл конфигурации
Я получаю эту ошибку при попытке установить глобальной конфигурации:
13 ответов
/.gitconfig файл создан.
Ie: с какими правами он связан?
решил проблему в моем случае.
просто запустите как администратор. вам нужно запустить программу в режиме запуска от имени администратора в windows
Пользователи Windows: убедитесь, что переменные среды настроены правильно.
у меня было следующее На мое имя пользователя ‘скрепки‘:
My Computer (right-click) > Properties > Advanced (tab) > Environment Variables (under System Variables) :
Git пытается создать файл конфигурации на диске C:/, но у него нет разрешения на это.
/.gitconfig.lock ) в домашнем каталоге пользователя.
Проверьте разрешения и попробуйте создать один.
если это удастся, вы должны удалить этот файл
Я «испытал» эту ошибку в Windows, потому что мое имя (и, следовательно, %HOMEPATH% ) содержит символ не ascii ( é ). Либо git, либо cmd.exe или что-то еще не мог справиться с этим.
Это может быть вызвано наличием
/.gitconfig хранит настройки.возможно, этот файл может быть артефактом ранее запущенного git, который был прерван по какой-то причине, например, Ansible timed out или ^C
просто используйте следующую команду если вы хотите установить настройки на уровне системы: