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:
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.
So far I have tried cloning the my heroku app repo in both of the ways mentioned ( git clone...
and heroku:git clone -a...
). 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. 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. My understanding so far is that there are no differences between the two mentioned ways of cloning a repo.
*Please note that there is no github involved in this at all.
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
So check your git remote -v
in both: you will see the difference.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.