Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why are ignored files not being ignored?

So I know variants of this questions have been asked and answered before, so first I want to go through some of my own research to show you that I do not have a duplicate.

  1. The git ignore is not actually a .gitignore file: .gitignore is not working
    • My file is called .gitignore and I have set widows to show me the whole filename of all filetypes. (The file was called Unity.ignore, renaming it did not solve the issue)
  2. The .gitignore was added after tracking files, and you need to untrack them first. Like this: .gitignore not working in github for mac program
    • No, the .gitignore was added to an empty repo. Made sure to commit.
  3. The .gitignore file is not placed correctly.
    • Now i am not to savvy with Linux and bash, but I've been told to place it in root and I think that is what I have done here.

The first two are the main reasons I see people having problems with .gitignore files but that is not where I am having a problem. The last one i am 99% sure is also not the problem.

After telling git to ignore my Library and Temp folder, any files from temp and Library still shows up in the GitHub client for windows when preparing to commit: Linked image since Imgur is having problems

Edit: Same issue when viewing the repo in SmartGit

And my .gitignore file

# =============== #
# Unity generated #
# =============== #
[Tt]emp/
[Oo]bj/
[Bb]uild
/[Ll]ibrary/
sysinfo.txt
*.stackdump

# ============================================= #
# Visual Studio / MonoDevelop / Rider generated #
# ============================================= #
[Ee]xported[Oo]bj/
.vs/
/*.userprefs
/*.csproj
/*.pidb
/*.suo
/*.sln*
/*.user
/*.unityproj
/*.booproj
/.idea*/

# ============ #
# OS generated #
# ============ #
.DS_Store*
._*
.Spotlight-V100

Stack Overflow community, thank you in advance. This is driving me nuts.

I have been made aware that the problem had to do with that folders being created by unity and that somehow that messed up the order of ignoring/tracking and i am investigating.

like image 528
TheLemur Avatar asked Feb 28 '17 20:02

TheLemur


1 Answers

I have never used a .gitignore which is named Unity.gitignore. Maybe I am wrong but I think the file name has to be .gitignore literally i.e. without any suffix.

[Edit]:
You can check git's ignore rules by the following command:

git check-ignore -v MY_FILE_NAME

Another point to check is the .gitignore_global file, although I don't think this solves your problem.

Last not least Unix vs. Windows: Do you have the appropriate line endings, especially when working under Windows?

You can have a look at one of my Unity projects at GutHub for example https://github.com/kayy/BundleVersionChecker. This definitely works

like image 126
Kay Avatar answered Sep 18 '22 01:09

Kay