Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Sourcetree started tracking thumbs.db

Vipul Kapoor November 9, 2016

I don't know what I did or If I did it but Sourcetree has suddenly started tracking thumbs.db files in all my repositories. I don't know if Windows was not generating thumbs.db previously or sourcetree was never tracking them, but this time, they're everywhere.

It's not possible to remove all of them individually because every folder has it and gitignore will only work for repositories created in the future. What do I do about the old repositories?

2 answers

0 votes
thinsoldier
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 10, 2016

How many commits back do you have to go to find a commit state that does not contain a thumbs.db file?

You could make a new branch at that commit, then cherry pick the next commit (which would be the one where you first accidentally started tracking the thumbs.db file), then delete thumbs.db and commit but choose to amend the previous commit, all commits after that (unless the thumbs.db file changed in those also) should be able to cleanly cherry pick over to your new branch. Then delete the old branch and rename the new branch with the name of the old branch.

0 votes
Seth
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 9, 2016

.gitignore works on current and future commits in any repository.

However, .gitignore only affects files that aren't already being tracked.

Definitely add thumbs.db to your .gitignore, but you'll also need to delete all the thumbs.db files and commit that. You might try this solution (make sure to back up the repo first just in case): https://confidentialfiles.wordpress.com/2010/06/02/a-quick-way-to-delete-all-files-with-a-certain-name-pattern-in-windows/

After you've committed the deletion AND added thumbs.db to your gitignore, the thumbs.db files should no longer show up in SourceTree, even if Windows re-creates them.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events