Git add not working with .png files?

前端 未结 5 1167
耶瑟儿~
耶瑟儿~ 2020-12-09 05:44

I have a dirty working tree, dirty because I made changes to source files and touched up some images. I was trying to add just the images to the index, so I ran this command

5条回答
  •  情话喂你
    2020-12-09 06:46

    git ls-files is a good way to list everything in your git repo

    For your case you can do something like

    git ls-files --modified | grep '\.png$' | xargs git add
    

    List the modified files, filter by extension (.png in this case) and git add the resultant entries

提交回复
热议问题