How to list all unchanged (tracked) files?

痴心易碎 提交于 2019-12-22 05:17:10

问题


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 git
  • git 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...



来源:https://stackoverflow.com/questions/31447637/how-to-list-all-unchanged-tracked-files

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