如何为一个目录级别“git ls-files”。 [英] how to `git ls-files` for just one directory level.

查看:243
本文介绍了如何为一个目录级别“git ls-files”。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用msysgit(1.7.9),并且正在寻找 git ls-files 命令的正确调用以显示(跟踪的)当前级别的文件和目录,如果更容易,可以使用索引或当前工作目录。

基本上它会给出一个类似于Github上看到的目录列表。来自Windows,我并不太熟悉正确的方式(?)。

解决方案

我想你要 git ls-tree HEAD sed'd去尝尝。对于目录,ls-tree输出的第二个单词是 tree blob 用于文件,为submodulesm提交,文件名就是ascii标签后面的所有内容


I'm using msysgit (1.7.9), and I'm looking for the right invocation of the git ls-files command to show just the (tracked) files and directories at the current level, either from the index, or the current working directory if that's easier.

Essentially it would give a directory listing similar that that you would see on Github. Coming from Windows, I'm not too familiar with the right way of doing the globbing(?).

解决方案

I think you want git ls-tree HEAD sed'd to taste. The second word of ls-tree's output will be tree for directories, blob for files, commit for submodulesm, the filename is everything after the ascii tab

这篇关于如何为一个目录级别“git ls-files”。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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