[英]How to solve the “failed to push some refs to” error in Windows PowerShell?
我开始通过自己的Git服务使用Git。 我创建了一个名为WhereIsMyPi
的项目。
这是正在发生的事情:
Windows PowerShell Copyright (C) 2016 Microsoft Corporation. Alle Rechte vorbehalten. Das Laden von persönlichen und Systemprofilen dauerte 1986 ms. ~\Documents\GitHub [(unknown)]> cd C:\Users\Suriyaa\Downloads\WhereIsMyPi ~\Downloads\WhereIsMyPi [master]> git push origin master Counting objects: 5, done. Delta compression using up to 4 threads. Compressing objects: 100% (5/5), done. Writing objects: 100% (5/5), 1.43 KiB | 0 bytes/s, done. Total 5 (delta 0), reused 0 (delta 0) remote: Skipping command-line '"C:\Program Files\Git\mingw64\bin\..\usr\bin\bash.exe"' remote: ('C:\Program Files\Git\mingw64\bin\..\usr\bin\bash.exe' not found) remote: Need a valid command-line; Edit the string resources accordingly remote: error: hook declined to update refs/heads/master To https://git.suriyaa.tk/SuriyaaKudoIsc/WhereIsMyPi.git ! [remote rejected] master -> master (hook declined) error: failed to push some refs to 'https://git.suriyaa.tk/SuriyaaKudoIsc/WhereIsMyPi.git' ~\Downloads\WhereIsMyPi [master]>
直到Git报告我没有bash命令,它才能正常工作。 这是错误输出:
remote: Skipping command-line '"C:\Program Files\Git\mingw64\bin\..\usr\bin\bash.exe"' remote: ('C:\Program Files\Git\mingw64\bin\..\usr\bin\bash.exe' not found) remote: Need a valid command-line; Edit the string resources accordingly remote: error: hook declined to update refs/heads/master To https://git.suriyaa.tk/SuriyaaKudoIsc/WhereIsMyPi.git ! [remote rejected] master -> master (hook declined) error: failed to push some refs to 'https://git.suriyaa.tk/SuriyaaKudoIsc/WhereIsMyPi.git'
路径C:\\Program Files\\Git\\mingw64\\bin\\..\\usr\\bin\\bash.exe
也不存在。 我实际的bash命令在C:\\Program Files\\Git\\mingw64\\bin
!
我该怎么办?
来自https://github.com/git-for-windows/git/issues/1204#issuecomment-321261122的解决方案!
问题出在cygwin64
的bash命令。 不是Git客户端或Git服务器!
我解决此问题的步骤:
bash
和git
依赖项 .bashrc
PATH=$PATH
(bash设置是主要问题)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.