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

查看:23
本文介绍了如何在 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)

如果不是最新的,末尾的(up to date)将被替换为(fast forwardable).

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>... <commit comment>,和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天全站免登陆