git:仅列出新文件 [英] git: list new files only

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

问题描述

当我做一个 git status 时,我得到一个以新文件为前缀的文件列表:。我怎样才能得到这个清单?我想在一个简单的循环中处理这些文件,在一个小shell脚本中。

c> git status --porcelain | grep^ A| cut -c 4 -


When I do a git status I get a list of files prefixed with new file: . How can I get only this list? I want to process this files in a simple loop in a little shell script.

解决方案

I would use something like git status --porcelain | grep "^A" | cut -c 4-

这篇关于git:仅列出新文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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