将Heroku应用程序链接到Github repo.为了什么?

Air*_*pov 19 github heroku

最近我在heroku应用程序设置中看到了这个字段.

将您的应用程序链接到GitHub存储库,以查看活动日志中的提交差异.

我试图在此字段中添加"myusername/myrepo",但它没有更改活动日志中的任何内容.我该如何使用此设置?为了什么?

and*_*axo 19

这很微妙,但您的活动日志已经改变.在Heroku设置中添加存储库时,活动日志中的提交哈希变为GitHub的链接,如下所示:

在此输入图像描述


sea*_*rke 10

如果要在Github中查看代码,则必须将Github添加为远程存储库

git remote add origin https://git.heroku.com/repo.git
git remote set-url --add origin https://github.com/username/repo.git
Run Code Online (Sandbox Code Playgroud)

每次你提交你的提交时,他们都会推送到heroku和github

git push origin
Run Code Online (Sandbox Code Playgroud)

现在,当您单击提交链接时,它们将带您到github.