Updates to the Git Commit Graph Feature
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 thegit 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!
相关文章
- 解决:git使用git push 命令跳出remote: Permission to A denied to B的问题
- SQLBackupAndFTP The server principal "NT AUTHORITYSYSTEM" is not able to access the database "xxxx"
- [Git] Use git add --patch for better commit history and mitigating bugs
- [Practical Git] Configure global settings with git config
- [Practical Git] Compare file changes with git diff
- Caused by: org.xml.sax.SAXParseException: The reference to entity "characterEncoding" must end with the ';' delimiter.
- [Git] Move some commits to a separate branch that I have accidentally committed to master
- 详解Git工作区、暂存区、历史记录区以及git reset、git revert、git checkout等撤销命令的区别
- error: pathspec 'master' did not match any file(s) known to git.
- 【Codeforces 231C】To Add or Not to Add
- 成功解决MSB8020 The build tools for v141 (Platform Toolset = ‘v141‘) cannot be found. To build using the
- 【K3s】第25篇 解决The connection to the server localhost:8080 was refused
- The current user does not have write permissions to the target environment.
- 【已解决】RuntimeError: The following handlers are available to decode the pixel data however they are
- git pull遇到错误:error: Your local changes to the following files would be overwritten by merge:
- Git:合并分支----git merge命令应用的三种情景
- git 解决push报错:[rejected] master -> master (fetch first) error: failed to push some refs to
- git版本控制管理实践-2
- Error:The supplied javaHome seems to be invalid. I cannot find the java executable. Tried location:
- git push报错 fatal: The current branch master has no upstream branch. To push the current
- Git使用SourceTree
- Git实战之git客户端上传文件到github
- 【Git】利用 GIT 做版本控制