简体   繁体   中英

How to git rm all deleted files from repo, excluding others

I have used this post Removing multiple files from a Git repo that have already been deleted from disk to figure out how to remove multiple files with git rm at once.

Now, I'd like to do this, excluding one directory. I tried this:

git rm $(git ls-files --deleted --exclude='sites/all/modules/imagecache_actions/')

but it didn't work. Am I misusing the exclude tag?

git ls-files -d | sed '/^sites\/all\/modules\/imagecache_actions\//d' | xargs git rm

-x --exclude选项仅适用于未跟踪的文件。

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