我可以使用哪些 git log 命令来简要或详细地查看我的历史记录?

我可以使用哪些 git log 命令来简要或详细地查看我的历史记录?

标准git log命令的细节比我有时需要的更多,但不是我真正想要的细节,例如所做的实际更改。

我可以使用什么来获得更好的摘要和详细视图?

答案1

我设置了以下别名来显示我认为有用的 git 日志变化

alias gl='git log'                 # Standard.  Quick to type.
alias gl1='git log --oneline'      # Nice oneline version
alias glf='git log --name-status'  # Lists out the files that were add/changed 
alias glp='git log -p'             # Shows the actual code changes

例子

$ gl
commit 4d56a61b6898e54a0789233b80ca7d9e22840bd5
Author: Michael Durrant <[email protected]>
Date:   Sat Mar 25 12:11:39 2017 -0400

LYNX-4822 Finish Page Object breakout

commit 812248b4878e905e918a6fc9ac29b35a19b1748f
Author: Michael Durrant <[email protected]>
Date:   Sat Mar 25 12:11:39 2017 -0400

LYNX-4822 Finish Page Object breakout

$ gl1
4d56a61 LYNX-4822 Finish Page Object breakout
812248b LYNX-4822 Finish Page Object breakout
5010291 Fix incorrectly named file
5126c41 LYNX-4933 Updated Nokogiri to 1.7.1 (#4041)

$ glf
commit 4d56a61b6898e54a0789233b80ca7d9e22840bd5
Author: Michael Currant <[email protected]>
Date:   Sat Mar 25 12:11:39 2017 -0400

    LYNX-4822 Finish Page Object breakout

M       spec/features/snap_engage_spec.rb

commit 812248b4878e905e918a6fc9ac29b35999999999
Author: Michael Currant <[email protected]>
Date:   Sat Mar 25 12:11:39 2017 -0400

    LYNX-4822 Finish Page Object breakout

M       spec/features/admin/blog_spec.rb
M       spec/features/landings/blue_car_2fields_min_foundation_mobile_landing_spec.rb
M       spec/features/prepop/prepop_3smf_spec.rb
M       spec/features/prepop/prepop_fullform_mobile_foundation_spec.rb
M       spec/features/survey_spec.rb
D       spec/support/feature_helpers/page_object.yml
M       spec/support/feature_helpers/page_object_3smf.yml
A       spec/support/feature_helpers/page_object_blog.yml
A       spec/support/feature_helpers/page_object_landing.yml
A       spec/support/feature_helpers/page_object_prepop.yml
A       spec/support/feature_helpers/page_object_shared_by_most_flows.yml
A       spec/support/feature_helpers/page_object_snap_engage.yml
A       spec/support/feature_helpers/page_object_survey.yml
M       spec/support/page_object.rb
$ glp
commit 4d56a61b6898e54a0789233b80ca7d9e22840bd5
Author: Michael Durrant <[email protected]>
Date:   Sat Mar 25 12:11:39 2017 -0400

    LYNX-4822 Finish Page Object breakout

diff --git a/spec/features/snap_engage_spec.rb b/spec/features/snap_engage_spec.rb
index 88cd5bd..e3fb924 100644
--- a/spec/features/snap_engage_spec.rb
+++ b/spec/features/snap_engage_spec.rb
@@ -6,6 +6,7 @@ RSpec.feature 'SnapEnagage' do
   let(:p) { PageObject.new }

   before :each do
+    p.snap_engage
     setup_everquote
     create_setting('enable_snap_engage').and_assign_to(config_group, config_group_setting_value: 'true')
   end

相关内容