Heroku“克隆一个空存储库”一个不为空的存储库的消息

发布于 2025-01-23 12:21:34 字数 1102 浏览 1 评论 0原文

考虑到Heroku/github问题,我正在尝试使用Heroku CLI发布说明。

它在我的管道中的一个环境中正常工作,但不是针对另一个环境。它返回“您似乎已经克隆了一个空存储库”。当我运行以下内容时。

heroku git:clone -a xxxxxx-release 
Cloning into 'xxxxxx-release'...
warning: You appear to have cloned an empty repository.

在此运行环境中有很多代码。我看了一下 - https://help.heroku.com/xobuhlkq/why-do-i-see-see-see-a-message-you-apr------------------------------------------------------------------- -cloned-an-empty-Repository-当使用 - heroku-git-clone - 但它说答案必须执行w/ buttons,我们不使用。我试图在那里混淆,但似乎无法为当前应用程序制作一个按钮,只是一个新应用程序。

因此,请注意,我可以尝试添加一个文件并提交它,但这也返回一个错误:

remote: !   Push rejected to xxxxxx-release.        
remote: 
To https://git.heroku.com/xxxxxx-release.git
  ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/xxxxxxx-release.git'

我现在对如何释放该分支机构感到不知所措。事先感谢您的任何帮助。

Given the Heroku/Github problems, I'm trying to use the Heroku CLI release instructions instead.

It worked fine for one of the environments in my pipeline, but it's not for the other. It returns "You appear to have cloned an empty repository." when I run the following.

heroku git:clone -a xxxxxx-release 
Cloning into 'xxxxxx-release'...
warning: You appear to have cloned an empty repository.

There is plenty of code on this running environment. I took a look at this - https://help.heroku.com/XOBUHLKQ/why-do-i-see-a-message-you-appear-to-have-cloned-an-empty-repository-when-using-heroku-git-clone - but it says the answer has to do w/ buttons, which we don't use. I've tried to muddle there but can't seem to make a button for a current app, just a new one.

S.O. notes that I can try adding one file and committing it, but that also returns an error:

remote: !   Push rejected to xxxxxx-release.        
remote: 
To https://git.heroku.com/xxxxxx-release.git
  ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/xxxxxxx-release.git'

I'm now at a loss on how to release to this branch. Thanks in advance for any help.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

水晶透心 2025-01-30 12:21:34

不要从Heroku克隆。

由于您一直在通过GitHub部署,因此您应该已经拥有本地副本。只需使用它:

cd project-directory/
heroku git:remote -a <YOUR_APP_NAME>  # Add a remote for your Heroku-hosted app
git push heroku  # Assuming you're already on main and want to deploy that version

如果出于某种原因,您没有本地副本,请从 github 中克隆,然后按上述操作。

克隆/从Heroku

Heroku应用程序的GIT存储库仅用于部署目的。从该存储库中克隆并不是正式支持的功能,只应作为最后的度假胜地尝试。 不要使用此存储库作为您的应用程序的规范“ Origin”存储库。而是使用自己的git服务器或版本控制服务,例如github。


当您从Heroku克隆时获得空存储库的原因是, github部署不会填充Heroku托管的存储库

github集成是否同步我的Heroku托管git repo?

对于启用了github集成的应用程序,Heroku not 将github存储库的内容同步到Heroku托管的存储库中。相反,Heroku直接从Github汲取源。

Don't clone from Heroku.

Since you've been deploying via GitHub you should already have a local copy. Just use that:

cd project-directory/
heroku git:remote -a <YOUR_APP_NAME>  # Add a remote for your Heroku-hosted app
git push heroku  # Assuming you're already on main and want to deploy that version

If, for whatever reason, you don't have a local copy, clone from GitHub then proceed as above.

Cloning / pulling from Heroku isn't meant to be part of your regular workflow:

A Heroku app’s Git repository is intended for deployment purposes only. Cloning from this repository is not officially supported as a feature and should be attempted only as a last resort. Do not use this repository as your app’s canonical “origin” repository. Instead, use your own Git server or a version control service such as GitHub.

And the reason you're getting an empty repository when you clone from Heroku is that GitHub deploys don't populate the Heroku-hosted repository:

Does the GitHub integration sync to my Heroku-hosted Git repo?

For apps with GitHub integration enabled, Heroku does not sync the contents of the GitHub repo to the Heroku-hosted repo. Instead, Heroku pulls source directly from GitHub.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文