I unzipped an older "git-image" onto my git repository and most of the files have been changed. I would like to know which files remained untouched. How to list these files?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
I didn't find anything purely git, but with some bash it is possible:
( git ls-files --modified ; git ls-files ) | sort | uniq -u
explanation
git ls-files
lists all files tracked by gitgit ls-files --modified
lists all the modified files tracked by git- the rest is some bash scripting to remove the duplicates from both lists.
回答2:
Maybe, if you unzip a archive, you may also won't use git but unzip -u
? It echos (the name of) all updated files and you may extract the list with sed or something if you like...