简体   繁体   中英

How can I tell which files have been marked as “assume unchanged” in git

This answer shows you how to mark a file that is managed by git as "I don't want changes from the repo for this file" - IE to have your own local untracked version of that file, even though it remains under revision control by git in the remotes.

The question is "How can I tell which files have been marked this way?" ... a good thing to be able to check, if you are using this feature!


Note: mentioned in comments below, skip-worktree is probably a better tool for the job than assume-unchanged . Nonetheless, this question documents how to find assume-unchanged files.

Slight improvement to @GreenAsJade answer:

git ls-files -v | grep "^[a-z]"

That works for zsh users.

... the answer was provided in comments of the answer linked above: git ls-files -v will show "assume unchanged" files as lower case letter.

So you can find them like this:

git ls-files -v | grep ^[az]

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