git: stage only new files

后端 未结 8 2165
走了就别回头了
走了就别回头了 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:04

    I suggest something like this to copy:

    for i in source/path ; do cp source/path/$i ./$i ; git add $i ; done
    

    I'm not very well at shell scripting, but this would be an attempt

提交回复
热议问题