gpt4 book ai didi

git - Windows 10 Git Bash 在提交 : is this normal? 时挂起大约五分钟

转载 作者:行者123 更新时间:2023-12-05 04:20:25 25 4
gpt4 key购买 nike

我的 GitBash 版本是 2.36.1
我的 Mintty 版本是 3.6.1 (x86_64-pc-msys) [Windows 19044]

在运行以下命令时,我的 GitBash 的 Mintty 终端在提交时挂起大约五分钟:

<user> <path> (master)
$ git add .

<user> <path> (master)
$ git commit -m "..."
Auto packing the repository in background for optimum performance.
See "git help gc" for manual housekeeping.
Enumerating objects: 384, done.
Counting objects: 100% (17/17), done.
Delta compression using up to 4 threads
Compressing objects: 100% (16/16), done.
Writing objects: 100% (17/17), done.
Total 17 (delta 4), reused 0 (delta 0), pack-reused 0
Removing duplicate objects: 100% (256/256), done.

它在这里挂了大约五分钟。
它以前从未这样做过。
这通常是可能的还是我可能做错了什么(如果是,是什么以及如何纠正它) ?

编辑:.git 文件夹的钩子(Hook): my .git folder hooks

编辑 3:删除了在“git status”命令上显示 trace2 日志的编辑 2,在编辑 3 中,我在最新的“git commit”上发布了 trace2 日志:

commit -m <my message>
d0 | main | data_json | r0 | 0.036147 | 0.036147 | process | windows/ancestry:["bash.exe","bash.exe"]
d0 | main | def_repo | r1 | | | | worktree:'<my path>'
d0 | main | cmd_name | | | | | commit (commit)
d0 | main | region_enter | r1 | 0.112412 | | index | label:do_read_index .git/index
d0 | main | region_enter | r1 | 0.114001 | | cache_tree | ..label:read
d0 | main | region_leave | r1 | 0.114116 | 0.000115 | cache_tree | ..label:read
d0 | main | data | r1 | 0.114183 | 0.001771 | index | ..read/version:2
d0 | main | data | r1 | 0.114214 | 0.001802 | index | ..read/cache_nr:401
d0 | main | region_leave | r1 | 0.114240 | 0.001828 | index | label:do_read_index .git/index
d0 | main | region_enter | | 0.115291 | | index | label:refresh
d0 | main | data | | 0.118960 | 0.003669 | index | ..refresh/sum_lstat:401
d0 | main | data | | 0.119016 | 0.003725 | index | ..refresh/sum_scan:0
d0 | main | region_leave | | 0.119039 | 0.003748 | index | label:refresh
d0 | main | region_enter | r1 | 0.226613 | | unpack_trees | label:unpack_trees
d0 | main | region_enter | r1 | 0.227008 | | unpack_trees | ..label:traverse_trees
d0 | main | region_leave | r1 | 0.227473 | 0.000465 | unpack_trees | ..label:traverse_trees
d0 | main | region_leave | r1 | 0.228410 | 0.001797 | unpack_trees | label:unpack_trees
d0 | main | region_enter | r1 | 0.228996 | | diff | label:setup
d0 | main | region_leave | r1 | 0.229037 | 0.000041 | diff | label:setup
d0 | main | region_enter | r1 | 0.229053 | | diff | label:write back to queue
d0 | main | region_leave | r1 | 0.229067 | 0.000014 | diff | label:write back to queue
d0 | main | region_enter | r1 | 0.254939 | | status | label:worktrees
d0 | main | region_enter | r1 | 0.255650 | | diff | ..label:setup
d0 | main | region_leave | r1 | 0.255705 | 0.000055 | diff | ..label:setup
d0 | main | region_enter | r1 | 0.255731 | | diff | ..label:write back to queue
d0 | main | region_leave | r1 | 0.255752 | 0.000021 | diff | ..label:write back to queue
d0 | main | region_leave | r1 | 0.255774 | 0.000835 | status | label:worktrees
d0 | main | region_enter | r1 | 0.255795 | | status | label:index
d0 | main | region_enter | r1 | 0.256585 | | unpack_trees | ..label:unpack_trees
d0 | main | region_enter | r1 | 0.256929 | | unpack_trees | ....label:traverse_trees
d0 | main | region_leave | r1 | 0.256993 | 0.000064 | unpack_trees | ....label:traverse_trees
d0 | main | region_leave | r1 | 0.257023 | 0.000438 | unpack_trees | ..label:unpack_trees
d0 | main | region_enter | r1 | 0.257040 | | diff | ..label:setup
d0 | main | region_leave | r1 | 0.257053 | 0.000013 | diff | ..label:setup
d0 | main | region_enter | r1 | 0.257066 | | diff | ..label:write back to queue
d0 | main | region_leave | r1 | 0.257079 | 0.000013 | diff | ..label:write back to queue
d0 | main | region_leave | r1 | 0.257093 | 0.001298 | status | label:index
d0 | main | region_enter | r1 | 0.257114 | | status | label:untracked
d0 | main | region_enter | r1 | 0.257441 | | dir | ..label:read_directory
d0 | main | region_enter | r1 | 0.257591 | | index | ....label:name-hash-init
d0 | main | region_leave | r1 | 0.257678 | 0.000087 | index | ....label:name-hash-init
d0 | main | data | r1 | 0.259703 | 0.002262 | read_directo | ....path:
d0 | main | data | r1 | 0.259737 | 0.002296 | read_directo | ....directories-visited:29
d0 | main | data | r1 | 0.259753 | 0.002312 | read_directo | ....paths-visited:454
d0 | main | region_leave | r1 | 0.259766 | 0.002325 | dir | ..label:read_directory
d0 | main | region_leave | r1 | 0.259782 | 0.002668 | status | label:untracked
d0 | main | data | r1 | 0.260047 | 0.260047 | status | count/changed:0
d0 | main | data | r1 | 0.260069 | 0.260069 | status | count/untracked:0
d0 | main | data | r1 | 0.260083 | 0.260083 | status | count/ignored:0
d0 | main | region_enter | r1 | 0.260096 | | status | label:print
d0 | main | region_leave | r1 | 0.262113 | 0.002017 | status | label:print
d0 | main | data | r1 | 0.262167 | 0.262167 | fsync | fsync/writeout-only:0
d0 | main | data | r1 | 0.262183 | 0.262183 | fsync | fsync/hardware-flush:0
d0 | main | data_json | r1 | 0.262521 | 0.262521 | process | windows/memory:{"PageFaultCount":5233,"PeakWorkingSetSize":9674752,"PeakPagefileUsage":7364608}
d0 | main | exit | | 0.262553 | | | code:1
d0 | main | data_json | r1 | 0.262570 | 0.262570 | traverse_tre | statistics:{"traverse_trees_count":2,"traverse_trees_max_depth":1}
d0 | main | atexit | | 0.262588 | | | code:1
d0 | main | version | | | | | 2.36.1.windows.1
d0 | main | start | | 0.012317 | | | 'C:\Program Files\Git\mingw64\bin\git.exe' rev-parse --git-dir --is-inside-git-dir --is-bare-repository --is-inside-work-tree --short HEAD
d0 | main | data_json | r0 | 0.052169 | 0.052169 | process | windows/ancestry:["bash.exe","bash.exe","bash.exe","bash.exe"]
d0 | main | cmd_name | | | | | rev-parse (rev-parse)
d0 | main | def_repo | r1 | | | | worktree:'<my path>'
d0 | main | data | r1 | 0.065587 | 0.065587 | fsync | fsync/writeout-only:0
d0 | main | data | r1 | 0.065763 | 0.065763 | fsync | fsync/hardware-flush:0
d0 | main | data_json | r1 | 0.066035 | 0.066035 | process | windows/memory:{"PageFaultCount":5960,"PeakWorkingSetSize":7704576,"PeakPagefileUsage":5218304}
d0 | main | exit | | 0.066077 | | | code:0
d0 | main | atexit | | 0.066102 | | | code:0
d0 | main | version | | | | | 2.36.1.windows.1
d0 | main | start | | 0.011809 | | | 'C:\Program Files\Git\mingw64\bin\git.exe' config --bool core.sparseCheckout
d0 | main | data_json | r0 | 0.053999 | 0.053999 | process | windows/ancestry:["bash.exe","bash.exe","bash.exe","bash.exe"]
d0 | main | def_repo | r1 | | | | worktree:'<my path>'
d0 | main | cmd_name | | | | | config (config)
d0 | main | data | r1 | 0.058257 | 0.058257 | fsync | fsync/writeout-only:0
d0 | main | data | r1 | 0.058297 | 0.058297 | fsync | fsync/hardware-flush:0
d0 | main | data_json | r1 | 0.058552 | 0.058552 | process | windows/memory:{"PageFaultCount":5874,"PeakWorkingSetSize":7675904,"PeakPagefileUsage":3547136}
d0 | main | exit | | 0.058593 | | | code:1
d0 | main | atexit | | 0.058619 | | | code:1
d0 | main | version | | | | | 2.36.1.windows.1
d0 | main | start | | 0.012306 | | | 'C:\Program Files\Git\mingw64\bin\git.exe'

这里有什么异常吗?谢谢!

最佳答案

这可能是完全正常的。线索就在这一行(以及后面的内容)中:

Auto packing the repository in background for optimum performance.

this 中写得很好回答,一些 Git 命令(包括 git commit since Git 2.17 )调用 git gc --auto。当有足够多的松散对象时(当你使用 git 时,这会随着时间的推移而增加),此命令将开始打包这些松散对象。这样做是为了不时进行一些轻量级垃圾收集(另请参阅 git-scm docs)。

这花费的时间取决于您最近执行的操作以及您的 git 存储库中存在的对象类型。

我会说:让包装妥善完成,不要太担心这个。在此之后,您应该能够像以前一样使用 Git。这种自动垃圾收集只是偶尔发生。

希望这对您有所帮助!

关于git - Windows 10 Git Bash 在提交 : is this normal? 时挂起大约五分钟,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/74479979/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com