列出Git存储库中存在的所有文件 [英] List all the files that ever existed in a Git repository

查看:71
本文介绍了列出Git存储库中存在的所有文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是一个简化的方法,可以列出指定分支中存在的所有文件。 Strager的解决方案的变体:

  git log --pretty = format:--name-status |剪下-f2- | sort -u 

编辑:感谢Jakub为我教授更多在评论中,这个版本有一个更短的管道,让git有更多的机会让事情正确。

  git log --pretty =格式: - 仅限名称--diff-filter = A | sort -u 


Do you have a clean way to list all the files that ever existed in specified branch?

解决方案

This is a simplified variation of Strager's solution:

git log --pretty=format: --name-status | cut -f2- | sort -u

Edit: Thanks to Jakub for teaching me a bit more in the comments, this version has a shorter pipeline and gives git more opportunity to get things right.

git log --pretty=format: --name-only --diff-filter=A | sort -u

这篇关于列出Git存储库中存在的所有文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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