HI,
I cloned a new github repo, and i've never had problems ignoring files before. i have the following .gitignore file:
The .gitignore behaviour in SourceTree is still 100% implemented by Git, SourceTree just provides some assistance in adding items to the ignore files. So SourceTree itself can't avoid using the .gitignore files, this is just git. You can ignore files from SourceTree, just right-click and select Ignore (although right now you can only do this on single files, but can expand the match pattern in the resulting dialog to mean the parent folder or a wildcard).
If this is the global gitignore, check Preferences > Git to make sure the correct path to this is being used. If it's the repo-specific one then I don't know why that's not working if it's called '.gitignore', as I say it's only Git that can pick this up, not SourceTree, and mine are working fine.
Version: 1.5.1
Git: System 1.7.10
I have roughly the following .gitignore file:
target/
.project
.classpath
If I execute:
git status
It correctly shows only a single file as changed. However, SourceTree shows many files in the Maven's folders as untracked and ready for adding. If I select Show Ignored, it shows only the .classpath and .project files as ignored. However, all files in the target/ folders are showed as pending.
Please see the answer to the original question - SourceTree actually just calls 'git status' under the surface and relies on its own behaviour for ignored files, therefore I can't understand this. If possible, please provide an example repository so we can investigate further (if you don't want to post it publicly, please raise an issue at https://support.atlassian.com where you can do it privately).
I had a similar problem, but it turned out that my gitignore_global.txt was in the wrong place. I had to move it to %userprofile%\.git\gitignore_global.txt and then it started working (%userprofile% usually points to c:\users\<username>)
Hello, I can't ignore files from SourceTree submenu - it's always disabled
I cannot ignore files sometimes .. very frustrating .. what can i do?
Yeah why is the "ignore" menu option in SourceTree always greyed out?
What's the point of that?
First right-click on a file and press 'Stop Tracking'.
The file will stay in the 'Unstaged Files'-list.
Than right-click again and press 'Ignore'.
Same here i cannot ignore files from submenu
This, as well as pointing sourcetree to [%userprofile%\.git\gitignore_global.txt] in the Tools>Options>git> Global ignore list... helped fix my global ignore file issues
I can ignore new file create by me, but file i checkout from other user, i edit and can't ignore this file. I see this bug for along time but you didn't fix, have more people have same problem like me.
My impression is that files with name starting with '.' (dot) (for example .classpath) will show up in 'Unstaged files' (having set Show only: modified)
EVEN IF these files are listed in .gitignore
No, this is not working for years and still a pain in the ass. It is a really annoying bug. If a file is already tracked it is IMPOSSIBLE to make SourceTree to ignore this file. I have lost almost two days of work trying to solve this issue and it is not possible unless you manually un-track the files from the command line with Git.
No you can not. Within SourceTree UX is NOT possible.
This worked for me. Thanks!
Does not work for me either. The option to ignore is never available, whether you stop tracking the file or not.
Further to this, Source Tree pertinently ignores all my attempts to point it to a global .gitignore file.
As i'm using Visual Studio, I have a .gitignore file with content that can be found in the following link:
https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
I have pointed to the .gitignore file with the above content from 3 locations in SourceTree:
1) settings->advanced 2) tools->options git and 3) tools->options mercurial.
The .gitignore file is all but ignored, and every time I compile in Visual Studio the temporary files that are on the ignore list in my .gitignore file still show up in the unstaged files in source tree. Me and my collegues really want to use SourceTree with git but this is making it all but impossible.
Does not work for me either. See my reply to the accepted answer above.
It looks like you're new here. Sign in or register to get started.