我刚刚意识到,如果git-status输出一些最新的提交消息,而不仅仅是一个Your branch is ahead of ...,那么它可能会非常方便(例如,当您执行git commit时,可以为您的提交提供更好的“上下文感”),这样就可以像这样
# 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看起来就像这样
# 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短时间的谷歌搜索并没有找到什么好东西。
发布于 2010-12-07 00:44:53
根据目前对format_tracking_info的研究(请参阅remote.c),在当前的git中还没有内置的方法来做到这一点。
您最好的选择可能是向git@vger.kernel.org发送一封功能请求邮件。
发布于 2010-12-07 05:59:07
您可以为日志创建别名,例如:
git config --global alias.last 'log --oneline --decorate -n5'https://stackoverflow.com/questions/4367831
复制相似问题