[英]What is the difference between heroku git:clone -a <app> and git clone <heroku-git-url>?
I deleted the local repo of my heroku app, then I wanted to clone it, so normally I use git clone
, which worked in this case:我删除了我的 heroku 应用程序的本地存储库,然后我想克隆它,所以通常我使用
git clone
,它在这种情况下有效:
git clone https://git.heroku.com/<app-name>.git
. git clone https://git.heroku.com/<app-name>.git
。 However, in the settings of my app on Heroku's dashbord, it says I should use heroku git:clone -a <app-name>
(this requires Heroku CLI which I already have installed.但是,在 Heroku dashbord 上我的应用程序设置中,它说我应该使用
heroku git:clone -a <app-name>
(这需要我已经安装的 Heroku CLI。
So far I have tried cloning the my heroku app repo in both of the ways mentioned ( git clone...
and heroku:git clone -a...
).到目前为止,我已经尝试以提到的两种方式(
git clone...
和heroku:git clone -a...
)克隆我的 heroku 应用程序存储库。 In both cases it worked and I got my source code properly cloned.在这两种情况下它都有效并且我正确地克隆了我的源代码。
In both cases node_modules
was not cloned, which is understandable since I run npm i
to install the needed ones specified in the package.json
file.在这两种情况下,
node_modules
都没有被克隆,这是可以理解的,因为我运行npm i
来安装package.json
文件中指定的所需模块。 The question is: what is the difference between these two ways of cloning?问题是:这两种克隆方式有什么区别? I push my code using
git push heroku master
and that also works fine.我使用
git push heroku master
推送我的代码,这也很好用。 My understanding so far is that there are no differences between the two mentioned ways of cloning a repo.到目前为止,我的理解是提到的两种克隆 repo 的方法之间没有区别。
*Please note that there is no github involved in this at all. *请注意,这里根本不涉及 github。
The heroku git:clone
command has its source in packages/git/src/commands/git/clone.ts
, and, from the documentation , mainly adds a heroku
Git remote to simplify future pushes heroku git:clone
命令的源代码在packages/git/src/commands/git/clone.ts
,并且,从文档中,主要添加了一个heroku
Git remote 以简化未来的推送
So check your git remote -v
in both: you will see the difference.所以在两者中检查你的
git remote -v
:你会看到不同之处。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.