Git 如何解决这个问题;未能将某些引用推送到“引用”;Windows PowerShell中的错误?
我开始在自己的Git服务中使用Git。我创建了一个名为Git 如何解决这个问题;未能将某些引用推送到“引用”;Windows PowerShell中的错误?,git,bash,powershell,mingw-w64,Git,Bash,Powershell,Mingw W64,我开始在自己的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\Su
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]>
Windows PowerShell
版权所有(C)2016年微软公司。好的。
Das Ladden von persönlichen and Systemprofilen dauerte 1986 ms。
~\Documents\GitHub[(未知)]>cd C:\Users\Suriyaa\Downloads\WhereIsMyPi
~\Downloads\whereismpi[master]>git推送源主机
计数对象:5,完成。
增量压缩最多使用4个线程。
压缩对象:100%(5/5),完成。
写入对象:100%(5/5),1.43千字节/秒,完成。
总计5(增量0),重复使用0(增量0)
远程:跳过命令行“C:\Program Files\Git\mingw64\bin\..\usr\bin\bash.exe”
远程:('C:\ProgramFiles\Git\mingw64\bin\..\usr\bin\bash.exe'未找到)
远程:需要有效的命令行;相应地编辑字符串资源
远程:错误:钩子拒绝更新refs/heads/master
到https://git.suriyaa.tk/SuriyaaKudoIsc/WhereIsMyPi.git
! [远程拒绝]主机->主机(拒绝挂钩)
错误:无法将某些引用推送到'https://git.suriyaa.tk/SuriyaaKudoIsc/WhereIsMyPi.git'
~\Downloads\whereismpi[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”
远程:('C:\ProgramFiles\Git\mingw64\bin\..\usr\bin\bash.exe'未找到)
远程:需要有效的命令行;相应地编辑字符串资源
远程:错误:钩子拒绝更新refs/heads/master
到https://git.suriyaa.tk/SuriyaaKudoIsc/WhereIsMyPi.git
! [远程拒绝]主机->主机(拒绝挂钩)
错误:无法将某些引用推送到'https://git.suriyaa.tk/SuriyaaKudoIsc/WhereIsMyPi.git'
路径C:\ProgramFiles\Git\mingw64\bin\..\usr\bin\bash.exe
也不存在。我的实际bash命令位于C:\ProgramFiles\Git\mingw64\bin
中
我该怎么办
来自的解决方案强>
问题在于cygwin64
中的bash命令。不是Git客户端或Git服务器
解决此问题的步骤如下:
- 我重新安装Git和cygwin64
- 在cygwin64中安装
和bash
依赖项git
- 删除所有我的命令并将以下内容放入
中:
在PATH=$PATH
(bash设置是主要问题)中。bashrc
- 重新启动计算机
- 启动一个新的Git存储库
- 做一些承诺
- 将提交推送到我的Git服务器
- ✅ 固定的
- 指出正确的路径?不太正确。Git工作正常,但Bash是当前的问题。我需要一个有效的命令行来相应地编辑钩子的字符串资源。您是否愿意详细说明bash是以什么方式出现的问题?