首页 > 其他 > 详细

Updates to the Git Commit Graph Feature

时间:2020-01-09 11:20:10      阅读:126      评论:0      收藏:0      [点我收藏+]

Updates to the Git Commit Graph Feature

Finally, the most immediately-visible improvement is the time it takes to sort commits by topological order.

This algorithm is the critical path for git log --graph.

Before the commit-graph, Git needed to walk every reachable commit before returning a single result.

 

Sounds Great! What do I need to do?

If you are using Git 2.23.0 or later, then you have all of these benefits available to you! You just need to enable the following config settings:

  • git config --global core.commitGraph true: this enables every Git repo to use the commit-graph file, if present.

  • git config --global gc.writeCommitGraph true: this setting tells the git gc command to write the commit-graph file whenever you do non-trivial garbage collection. Rewriting the commit-graph file is a relatively small operation compared to a full GC operation.

  • git commit-graph write --reachable: this command will update your commit-graph file to contain all reachable commits. You can run this to create the commit-graph file immediately, instead of waiting for your first GC operation.

In the recently-released Git version 2.24.0, core.commitGraph and gc.writeCommitGraph are on by default, so you don’t need to set the config manually. If you don’t want commit-graph files, then explicitly disable these settings and tell us why this isn’t working for you. We’d love to hear your feedback!

 

Updates to the Git Commit Graph Feature

原文:https://www.cnblogs.com/chucklu/p/12170294.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!