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.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yep, same here. 'Ignore' is never available from the context menu. You can 'Stop tracking' ok (and why would that be different to 'Ignore' anyway?)
Not a deal breaker for me but still, worth fixing, I think.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I've seen this before and I see it most often with .suo files that don't get ignored even though they are included in the .gitignore file.
But I think it's because I cloned a project before setting my global .gitignore file in the SourceTree GIT options.
So I think what happens is that I save something in Visual Studio and it updates the .suo file and I end up inadvertently including the .suo file in a commit.
I then realize later that I don't have the .gitignore defined in SourceTree because I'm seeing the .suo file show up under "Unstaged files".
So now I go and define my .gitignore in the SourceTree options but it still shows up under "Unstaged files" after saving my project in Visual Studio.
I think my mistake is that I saved the .suo into my .git repo before setting the .gitignore preference so once I've told GIT to track it, GIT can't ignore the .suo even though I've now set the .gitignore option.
To test this theory, since I now had the .gitignore set in SourceTree, I just cloned the project down again to a new location and then saved the project multiple times in Visual Studio and in this scenario I no longer see the .suo under "Unstaged files".
So I have to remember to not commit anything before defining the .gitignore option.
Alternatively, if I've committed before defining the .gitignore file, I can set the .gitignore location and then go back and remove the .suo file from the GIT repo.
To do this, just right-click the file and select "Stop Tracking". This stages a remove operation which has to be committed for SourceTree to stop tracking the file.
There's a good discussion of this here:
https://stackoverflow.com/questions/936249/how-to-stop-tracking-and-ignore-changes-to-a-file-in-git
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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'.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
No you can not. Within SourceTree UX is NOT possible.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This worked for me. Thanks!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Does not work for me either. See my reply to the accepted answer above.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello, I can't ignore files from SourceTree submenu - it's always disabled
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Same here i cannot ignore files from submenu
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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>)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yeah why is the "ignore" menu option in SourceTree always greyed out?
What's the point of that?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.