git: list new files only

前端 未结 6 1724
眼角桃花
眼角桃花 2020-12-23 13:54

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

6条回答
  •  感动是毒
    2020-12-23 14:08

    List of new files or to get files to be added to git, can be got using git status and grep command like git status -s | grep ??

    root@user-ubuntu:~/project-repo-directory# git status -s | grep ??
     ?? src/.../file1.js
     ?? src/.../file2.js
     ?? src/.../file3.js
     ....
    

提交回复
热议问题