如何列出所有未更改(跟踪)的文件?

编程入门 行业动态 更新时间:2024-10-09 17:23:00
本文介绍了如何列出所有未更改(跟踪)的文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我将较旧的"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.

更多推荐

如何列出所有未更改(跟踪)的文件?

本文发布于:2023-11-09 07:51:44,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1571786.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:文件

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!