首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何让git-status输出显示一些最新的提交消息?

如何让git-status输出显示一些最新的提交消息?
EN

Stack Overflow用户
提问于 2010-12-06 23:16:28
回答 2查看 673关注 0票数 0

我刚刚意识到,如果git-status输出一些最新的提交消息,而不仅仅是一个Your branch is ahead of ...,那么它可能会非常方便(例如,当您执行git commit时,可以为您的提交提供更好的“上下文感”),这样就可以像这样

代码语言:javascript
复制
# On branch master
# Your branch is ahead of 'origin/master' by 2 commits.
#
# Changes to be committed:
#   (use "git reset HEAD <file>..." to unstage)
#
#       modified:   Gemfile.lock
#
# Untracked files:
#   (use "git add <file>..." to include in what will be committed)
#
#       models.html
#       script/rails_ssl
#       spec.txt

看起来就像这样

代码语言:javascript
复制
# On branch master
# Your branch is ahead of 'origin/master' by 2 commits:
# z1s4c8 Use Rack::SSL to force SSL, make cookies secure
# a5f7qw Fixed department filter
#
# Changes to be committed:
#   (use "git reset HEAD <file>..." to unstage)
#
#       modified:   Gemfile.lock
#
# Untracked files:
#   (use "git add <file>..." to include in what will be committed)
#
#       models.html
#       script/rails_ssl
#       spec.txt

短时间的谷歌搜索并没有找到什么好东西。

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2010-12-07 00:44:53

根据目前对format_tracking_info的研究(请参阅remote.c),在当前的git中还没有内置的方法来做到这一点。

您最好的选择可能是向git@vger.kernel.org发送一封功能请求邮件。

票数 0
EN

Stack Overflow用户

发布于 2010-12-07 05:59:07

您可以为日志创建别名,例如:

代码语言:javascript
复制
git config --global alias.last 'log --oneline --decorate -n5'
票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/4367831

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档