git: stage only new files

后端 未结 8 2138
走了就别回头了
走了就别回头了 2020-12-10 05:21

When I have:

  • dirty working directory,
  • dirty staging area,
  • and I copied some new files to the project,

how do I stage only the

8条回答
  •  無奈伤痛
    2020-12-10 06:06

    A little improvement to the solution of bstpierre, you can use this variation to be able to specify the directory in which you want to add files:

    [alias]
      adduntracked="!f() { git add $(git ls-files -o --exclude-standard $@); }; f"
    

提交回复
热议问题