如何让git状态仅显示暂存的文件 [英] How to make git status show only staged files

查看:274
本文介绍了如何让git状态仅显示暂存的文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想只列出阶段性文件名。我无法为 git status 命令找到 - name-only 的等效标志。什么是好的选择?



文件列表将被传送到 php -l <​​/ code>(PHP lint语法检查器) 。

解决方案:完整的命令

  git diff --name-only --cached | xargs -l php -l 


解决方案使用 git diff --name-only (用 - cached 来获取暂存文件)


I would like to get a list of only the staged filenames. I can't find the equivalent flag for --name-only for the git status command. What is a good alternative?

The file list will be piped to php -l (PHP lint syntax checker).

Solution: the complete command

git diff --name-only --cached | xargs -l php -l

解决方案

Use git diff --name-only (with --cached to get the staged files)

这篇关于如何让git状态仅显示暂存的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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