猿问

Gig2go:在远程解包发送的包文件失败

我为此苦苦挣扎。我正在尝试使用以下代码将更改推送到 repo:


// Get remote

remote, err := repo.Remotes.Lookup("origin")

if err != nil {

    remote, err = repo.Remotes.Create("origin", repo.Path())

    if err != nil {

        return err

    }

}


// Get the branch

branch, err := repo.Branch()

if err != nil {

    return err

}


// Get the name

branchName, 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 资源后,我现在明白了错误的含义,但我仍然不知道是什么导致了它。


至尊宝的传说
浏览 340回答 2
2回答

潇湘沐

这是一个错误,发生在服务器上,所以查看的地方是它的日志。您是否尝试过对 git 本身进行相同的操作?我不记得了,但可能有一个额外的错误字符串,libgit2 目前没有返回。在服务器上解包的错误通常与在远程运行 git 的用户的权限有关。
随时随地看视频慕课网APP

相关分类

Go
我要回答