Git add not working with .png files?

前端 未结 5 1173
耶瑟儿~
耶瑟儿~ 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:38

    In doubt, try:

    git -A -- *.png 
    

    , which might be more comprehensive (git add man page)

    -A
    --all
    

    Like -u, but match against files in the working tree in addition to the index.
    That means that it will find new files as well as staging modified content and removing files that are no longer in the working tree.

    See SO question "Difference of “git add -A” and “git add .”"

提交回复
热议问题