如何在Heroku上查看远程Git修订版 [英] How to view remote Git revision on Heroku

查看:91
本文介绍了如何在Heroku上查看远程Git修订版的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为了部署到Heroku,我使用 git push heroku master 。但是,我如何看到我推到heroku的哪个版本? (我经常怀疑是否推出了最新版本)

For deploying to Heroku, I use git push heroku master. But how do I see which revision I pushed up to heroku? (I'm often in doubt if I pushed the recent version up)

对于那些不熟悉它的人,Heroku的创建脚本会生成一个远程git存储库,并将其推送到该存储库。

For those not familiar with it, Heroku's create script generates a remote git repository that you push to. Upon push, the code is deployed magically.

Heroku通过以下形式向本地添加远程存储库:

Heroku adds a remote repository to the local one in the form:

$ git remote add heroku git@heroku.com:appname.git

有关Heroku手动使用Git部署的更多信息

More info in Heroku's manual "Deploying with Git"

问题是:如何才能在Heroku存储库中看到最新版本?

Question is: How can I see latest version in Heroku repository?

推荐答案

并且想要确保你是最新的,那么你可以运行 git remote show heroku ,你会看到类似这样的输出:

If you've just pushed and want to make sure you're up-to-date, then you can just run git remote show heroku and you'll see output similar to this:

* remote heroku
  Fetch URL: git@heroku.com:XXX.git
  Push  URL: git@heroku.com:XXX.git
  HEAD branch: master
  Remote branch:
    master tracked
  Local ref configured for 'git push':
    master pushes to master (up to date)

(最新)最后会被(快速转发)取代,如果它不是最新的。

That (up to date) at the end will be replaced by (fast forwardable) if it is not up to date.

如果您想查看heroku远程控制台的完整提交日志,我知道如何才能首先检查它。 git checkout heroku / master 会为您提供当前的提交哈希和提交评论: HEAD现在位于< short commit hash> ...<提交评论> git log 会为您讲述故事的其余部分。

Or, if you're wanting to see the full commit log for the heroku remote, the only way I know how is to check it out first. git checkout heroku/master will give you the current commit hash and commit comment: HEAD is now at <short commit hash>... <commit comment>, and git log will give you the rest of the story.

这篇关于如何在Heroku上查看远程Git修订版的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆