2017-06-14 201 views
0

我開始使用Git和我自己的Git服務。我創建了一個名爲WhereIsMyPi的項目。如何解決Windows PowerShell中的「無法推送某些文件」錯誤?

這裏發生的事情:

 
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

我該怎麼辦?

+0

使[hook](https://git-scm.com/book/gr/v2/Customizing-Git-Git-Hooks)指向正確的路徑? –

+0

不是。 Git工作正常,但Bash是當前的問題。我需要一個有效的命令行來相應地編輯鉤子的字符串資源。 – Suriyaa

回答

0

https://github.com/git-for-windows/git/issues/1204#issuecomment-321261122的解決方案!

問題是cygwin64中的bash命令。不是Git客戶端或Git服務器!


我的步驟來解決這個問題:

  • 我重新安裝Git和cygwin64
  • 在cygwin64
  • 安裝bashgit依賴刪除我的所有命令,並把這個內容:PATH=$PATH.bashrc(bash設置是主要問題)
  • 重新啓動計算機
  • 啓動一個新的Git倉庫
  • 作了一次提交
  • 按承諾我的Git服務器
  • ✅固定。
  • Hooray!
相關問題