How does git detect that a file has been modified?

后端 未结 4 651
借酒劲吻你
借酒劲吻你 2020-12-01 03:36

How does git detect a file modification so fast?

Does it hash every file in the repo and compare SHA1s? This would take a lot of time, wouldn\'t it?

Or does

4条回答
  •  佛祖请我去吃肉
    2020-12-01 03:55

    Depending on platform, you should be able to find out what syscalls Git uses to figure out its status. Try strace git status on Linux, truss git status on SunOS, or the seemingly DTrace-based tool that Apple ships with its Developer Tools on Mac OS X.

提交回复
热议问题