我為此苦苦掙扎。我正在嘗試使用以下代碼將更改推送到 repo:// Get remoteremote, err := repo.Remotes.Lookup("origin")if err != nil { remote, err = repo.Remotes.Create("origin", repo.Path()) if err != nil { return err }}// Get the branchbranch, err := repo.Branch()if err != nil { return err}// Get the namebranchName, err := branch.Name()if err != nil { return err}if err := remote.Push([]string{"refs/heads/"+branchName}, &git.PushOptions{}); err != nil { return err}一切似乎都很好,但我不斷收到此錯誤:unpacking the sent packfile failed on the remote在閱讀了一些 git 資源后,我現(xiàn)在明白了錯誤的含義,但我仍然不知道是什么導(dǎo)致了它。
2 回答
瀟湘沐
TA貢獻(xiàn)1816條經(jīng)驗 獲得超6個贊
這是一個錯誤,發(fā)生在服務(wù)器上,所以查看的地方是它的日志。您是否嘗試過對 git 本身進(jìn)行相同的操作?我不記得了,但可能有一個額外的錯誤字符串,libgit2 目前沒有返回。
在服務(wù)器上解包的錯誤通常與在遠(yuǎn)程運行 git 的用戶的權(quán)限有關(guān)。
- 2 回答
- 0 關(guān)注
- 383 瀏覽
添加回答
舉報
0/150
提交
取消
