如何列出所有未更改(跟踪)的文件? [英] How to list all unchanged (tracked) files?

查看:101
本文介绍了如何列出所有未更改(跟踪)的文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将较旧的"git-image"解压缩到我的git存储库中,并且大多数文件已更改.我想知道哪些文件保持不变.如何列出这些文件?

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?

推荐答案

我没有发现任何纯粹的git,但是通过一些bash可以实现:

I didn't find anything purely git, but with some bash it is possible:

( git ls-files --modified ; git ls-files ) | sort | uniq -u

说明

  • git ls-files列出git跟踪的所有文件
  • git ls-files --modified列出了git跟踪的所有修改文件
  • 其余是一些bash脚本,用于从两个列表中删除重复项.
  • 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.

这篇关于如何列出所有未更改(跟踪)的文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆