简体   繁体   中英

git log filter with sparse checkout

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM