开发者

How do I totally ignore user generated images in Git?

开发者 https://www.devze.com 2023-02-01 11:34 出处:网络
I am a newbie to Git. I am in a branch \"maintenance\" and I want to switch back to \"master\"开发者_运维知识库, but I am receiving the error:

I am a newbie to Git.

I am in a branch "maintenance" and I want to switch back to "master"开发者_运维知识库, but I am receiving the error:

error: The following untracked working tree files would be overwritten by checkout:
vault/users/1/thumb.jpg
vault/users/1/speck.jpg
vault/users/1/prof.jpg
vault/users/1/mini.jpg
vault/users/1/full.jpg

I thought that these images were being ignored because in my .gitignore file, I said to ignore "vault/". Indeed, they don't show up as modified, or added, etc when trying to commit. It seems like the ignore worked.

So, how come when I try and checkout my master branch, it gives me this error?

NOTE: if this has been answered, I apologize - I did some looking but don't know what to search for to find my answer.


It would appear that someone has added those files in a previous commit.

I'd suggest that you back up those files (unless you're sure you don't need them), delete them, then do the checkout. You can then look through the log and find out when those files were added and (I'm guessing) create a new commit that removes them.

0

精彩评论

暂无评论...
验证码 换一张
取 消