git log filter with sparse checkout

拜拜、爱过 提交于 2021-01-29 12:27:57

问题


I have a large project that I use sparse checkout to exclude one directory (which is quite large). However, when I use git log, the commit in the directory that I already excluded with sparse checkout will show up, polluting my real interests.

The answer given for this question by specifying one directory doesn't work for me since I need to exclude one directory but include many. I came from perforce where if I specify ..., it will not include files or directories that were excluded by my p4 client spec.


回答1:


Use the exclude option with pathspecs. For instance:

$ git log --first-parent --name-status -- ':(exclude)plugin/'

in a clone of the syntastic repository doesn't show commit 69b0c3e85a319ad21f560d7b25524cf02921be82, while git log without the exclusion does show it.



来源:https://stackoverflow.com/questions/56139490/git-log-filter-with-sparse-checkout

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!