The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Sourcetree trying to stage ignored files

Coleman Horton
January 12, 2023

I started up sourcetree yesterday and found that it was suddenly trying to stage thousands of previously untracked files from directories that are in my .gitignore.

I have no idea what caused this - I haven't made any changes to Sourcetree or my .gitignore file.  When I try to select the offending files to ignore them Sourcetree hangs indefinitely.

This is not the first time something like this has happened.  Why does Sourcetree randomly decide to disregard my .gitignore?  Are there any plans to make the interface remain usable when there are thousands of unstaged files?  How can I get Sourcetree to start ignoring these files again?

1 answer

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

1 vote
Coleman Horton
January 13, 2023

I was able to remove some of these files with the following command:
git ls-files -c --ignored --exclude-standard -z | xargs -0 git rm --cached
git commit -am "Remove ignored files"

However, there were still thousands of files marked with a purple question mark that I had to remove manually using right click --> Ignore --> Ignore all files under...

Why does Sourcetree not respect my gitignore settings? If I go to Repository Settings --> Advanced --> Repository-specific ignore list --> Edit; it correctly opens my gitignore file - so clearly Sourcetree is aware of the gitignore file.

DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events