繁体   English   中英

如何解决Windows PowerShell中的“无法将某些引用推送到”错误?

[英]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服务器!


我解决此问题的步骤:

  • 我重新安装Git和cygwin64
  • 在cygwin64中安装bashgit依赖项
  • 删除我所有的命令,然后输入以下内容: .bashrc PATH=$PATH (bash设置是主要问题)
  • 重新启动电脑
  • 启动一个新的Git仓库
  • 做一些承诺
  • 推送提交到我的Git服务器
  • ✅固定。
  • 🎉万岁!

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM