Adding Only Untracked Files

前端 未结 11 1938
傲寒
傲寒 2020-12-07 07:04

One of the commands I find incredibly useful in Git is git add -u to throw everything but untracked files into the index. Is there an inverse of that? In the la

11条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-07 07:51

    Not exactly what you're looking for, but I've found this quite helpful:

    git add -AN
    

    Will add all files to the index, but without their content. Files that were untracked now behave as if they were tracked. Their content will be displayed in git diff, and you can add then interactively with git add -p.

提交回复
热议问题