如何git责怪目录 [英] How to git blame a directory

查看:63
本文介绍了如何git责怪目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道如何使用git blame来了解谁创建了一个目录.

I would like to know how to use git blame to know who created a single directory.

当我尝试时:

git blame DIRECTORY_NAME

我得到:

fatal: no such path DIRECTORY_NAME in HEAD

偶然地,目录是空的.有什么建议吗?

Incidentally, the directory is empty. Any suggestions?

推荐答案

尝试获取该目录的日志,然后使用-p选项查看发生的确切更改.

Try getting a log of just that directory, and use the -p option to see the exact changes that occurred.

$ git log -p <path to directory>

由于git似乎更多地关注文件内容,所以这可能仍不能告诉您确切的目录创建人,但是,仅在第一次将任何内容添加到其中时,您可能会得到一些有用的线索.

This still might not tell you exactly who created the directory, since git seems to focus more on file content, but you might get some helpful clues just from seeing the first time any content was added to it.

这篇关于如何git责怪目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆