git 如何解决git错误:服务器不允许请求未通告的对象3a2ceef391af73994dfeb0d8ef57ed6a52ef4238?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/51001919/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 13:08:49  来源:igfitidea点击:

How to solve git error: Server does not allow request for unadvertised object 3a2ceef391af73994dfeb0d8ef57ed6a52ef4238?

gitbitbucket

提问by Tazwar Utshas

I wanted to pull commit "3a2ceef391af73994dfeb0d8ef57ed6a52ef4238" from branch android. I used the command:

我想从分支 android 中提取提交“3a2ceef391af73994dfeb0d8ef57ed6a52ef4238”。我使用了命令:

$ git fetch origin 3a2ceef391af73994dfeb0d8ef57ed6a52ef4238

and it is showing this error,

它显示了这个错误,

error: Server does not allow request for unadvertised object 3a2ceef391af73994dfeb0d8ef57ed6a52ef4238

How to solve this problem?

如何解决这个问题呢?

采纳答案by Arount

According to this answerand the given sourceit looks like BitBucket does not allow you to fetch a commit id, only references.

根据这个答案给定的来源,看起来 BitBucket 不允许您获取提交 ID,只能获取引用。

I cannot say if you can configure this behavior, but I think you can:

我不能说您是否可以配置此行为,但我认为您可以:

  1. Pull the branch: git pull origin branchname
  2. Checkout the local commit id: git checkout <commitid>
  1. 拉分支: git pull origin branchname
  2. 检查本地提交 IDgit checkout <commitid>

回答by Sravya

git submodule syncas pointed in https://github.com/AppImage/AppImageKit/issues/511works for me.

git submodule sync正如https://github.com/AppImage/AppImageKit/issues/511 中指出的那样对我有用。

回答by Shital Shah

I got the same error and none of these resolved it. It turned out that I hadn't pushed submodule changes from my other computer (this would give 404 error when you click on submodule folder on GitHub). So pushing submodule, committing parent and pushing that as well resolved the error.

我遇到了同样的错误,但这些都没有解决。结果证明我没有从我的另一台计算机推送子模块更改(当您单击 GitHub 上的子模块文件夹时,这会产生 404 错误)。所以推送子模块,提交父模块并推送它也解决了错误。

Other solutions are git submodule update --recursiveand this.

其他解决方案是git submodule update --recursive这个

回答by notytony

I was facing such an error while doing a git pull. Doing below helped fix the issue for me.

我在执行 git pull 时遇到了这样的错误。在下面做有助于解决我的问题。

git remote prune origin
git pull

回答by Deepak rkm

You can follow the below steps to solve the above error .

您可以按照以下步骤解决上述错误。

> git init 
> git pull <reponame> branchname(optional) 
> git reset --hard <commit_id>

Note:make sure that You have committed and pushed your changes from local to remote already as reset --hard will leave any unsaved changes from local and it moves completely and get the files and folders of the commit which is irreversible with any changes not pushed. You may have a look in to these as well.

注意:确保您已经提交并将您的更改从本地推送到远程,因为重置 --hard 将保留本地未保存的任何更改,它会完全移动并获取提交的文件和文件夹,任何未推送的更改都是不可逆转的. 你也可以看看这些。

https://www.pylabz.com/2019/08/using-python-to-pull-files-of-git-hub.html#more

https://www.pylabz.com/2019/08/using-python-to-pull-files-of-git-hub.html#more

https://medium.com/@deepakr6242/using-python-to-extract-files-from-git-hub-repo-through-commits-id-2bdf76b2e0fd

https://medium.com/@deepakr6242/using-python-to-extract-files-from-git-hub-repo-through-commits-id-2bdf76b2e0fd