我跟着this tutorial (in french),這很好解釋和可以理解。我有GIT知識,因爲我使用自己的服務器在Gitlab中編譯我的項目。在OVH「Mutualisé」(共享)部署GIT項目
我被要求查看項目的進度。因此,我嘗試了幾天在共享主機OVH(PRO帳戶)上安裝GIT。
最終目標是重現本教程中解釋的內容,並直接在OVH服務器上合併代碼。
我按照步驟操作。
- 我初始化服務器上的git:
git init --bare
- 我然後創建一個本地文件夾,我把它堅持到遠程的git:
git remote add origin ssh://[email protected]_name.com/folder/test.git
- 然後我嘗試與遠程推送本地代碼:
git push origin master
而且我得到以下錯誤:fatal: protocol error: bad line length character: Usin
這是什麼錯誤?無論使用什麼方法,爲什麼我會得到這個?
編輯:
$ GIT_TRACE=2 GIT_TRACE_PACKET=2 git push origin master
10:53:29.947071 git.c:348 trace: built-in: git 'push' 'origin' 'master'
10:53:29.947071 run-command.c:335 trace: run_command: 'C:\Program Files (x86)\PuTTY\plink.exe' '[email protected]_name.com' 'git-receive-pack '\''/folder/test.git'\'''
fatal: protocol error: bad line length character: Usin
編輯 2:運行另一個命令:
ssh [email protected]_name.com git-receive-pack folder/test.git
00700000000000000000000000000000000000000000 capabilities^{} report-status delete-refs side-band-64k ofs-delta
0000
或(從根/folder
):
ssh [email protected]_name.com git-receive-pack /folder/test.git
fatal: '/folder/test.git' does not appear to be a git repository
如果我做一個ls
遠程git的文件夾:
~/folder/test.git $ ls
branches config description HEAD hooks info objects refs
可能重複的[Git遠程:錯誤:致命:協議錯誤:壞行長度字符:Unab](http://stackoverflow.com/questions/8170436/git-remote-error-fatal-protocol-error-bad -line-length-character-unab) –
嘗試使用'GIT_TRACE = 2'和'GIT_TRACE_PACKET = 2'運行命令:'GIT_TRACE = 2 GIT_TRACE_PACKET = 2 git push origin master'。這將導致Git吐出大量的調試信息,這可能會幫助您更好地理解正在發生的事情。 – jszakmeister
@jszakmeister謝謝。事實上,得到了更多的解釋錯誤。請參閱我的更新後的文章 – Zl3n