Adding Only Untracked Files

前端 未结 11 1904
傲寒
傲寒 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 08:05

    git ls-files -o --exclude-standard gives untracked files, so you can do something like below ( or add an alias to it):

    git add $(git ls-files -o --exclude-standard)
    

提交回复
热议问题