Cannot ignore

HI,

I cloned a new github repo, and i've never had problems ignoring files before. i have the following .gitignore file:

.DS_Store
.settings
.project
.buildpath
components/invoice/lead
var/file
var/decline
config.php

however, sourcetree ignores this .gitignore file and i can't even ignore files from source tree. What could be wrong?

greetings

10 answers

1 accepted

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.

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.

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.

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.

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'.

No you can not. Within SourceTree UX is NOT possible.

This worked for me. Thanks!

Does not work for me either.  See my reply to the accepted answer above.

Hello, I can't ignore files from SourceTree submenu - it's always disabled

I cannot ignore files sometimes .. very frustrating .. what can i do?

Same here i cannot ignore files from submenu

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>)

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 cannot ignore files sometimes .. very frustrating .. what can i do?

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.

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).

Yeah why is the "ignore" menu option in SourceTree always greyed out?

What's the point of that?

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

 

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published yesterday in Off-topic

Get to know our Atlassian User Group Leaders from Bengaluru, India

Meet @Dinesh Dhinakaran, @Vishnu Vasudeva, @Rajeev Verma, and Jamshid Nalakath: Our extraordinary AUG leaders from Bengaluru, India. These four work together to strengthen the bonds of their local co...

155 views 0 4
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you