1

I tried to find solution for me but my .gitignore file still doesn't work

I see this post, but it doesn't help me.

This is my gitignore file:

# Created by https://www.gitignore.io/api/android,macos

### Android ###
# Built application files
*.apk
*.ap_

# Files for the ART/Dalvik VM
*.dex

# Java class files
*.class

# Generated files
bin/
gen/
out/

# Gradle files
.gradle/
build/

# Local configuration file (sdk path, etc)
local.properties

# Proguard folder generated by Eclipse
proguard/

# Log Files
*.log

# Android Studio Navigation editor temp files
.navigation/

# Android Studio captures folder
captures/

# Intellij
*.iml
.idea/workspace.xml
.idea/tasks.xml
.idea/gradle.xml
.idea/dictionaries
.idea/libraries

# Keystore files
*.jks

# External native build folder generated in Android Studio 2.2 and later
.externalNativeBuild

# Google Services (e.g. APIs or Firebase)
google-services.json

# Freeline
freeline.py
freeline/
freeline_project_description.json

### Android Patch ###
gen-external-apklibs

### macOS ###
*.DS_Store
.AppleDouble
.LSOverride

# Icon must end with two \r
Icon


# Thumbnails
._*

# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk

But when I make rebild I see this in SourceTree: enter image description here

All files from libraryProjectFolder/Build folder ()

Community
  • 1
  • 1
Artem
  • 4,569
  • 12
  • 44
  • 86
  • Possible duplicate of [How to make Git "forget" about a file that was tracked but is now in .gitignore?](http://stackoverflow.com/questions/1274057/how-to-make-git-forget-about-a-file-that-was-tracked-but-is-now-in-gitignore) – 1615903 Mar 22 '17 at 05:19
  • @1615903 I try it but it doesn't help me – Artem Mar 22 '17 at 11:38

3 Answers3

3

I have a situation that I added a file on gitignore and for some reason that I don’t know it doesn't recognize this file on gitignore and still showing it on my working area. To ignore this file I used the command below:

git rm --cached myfile

I hope it can help anyone in the future.

Pankwood
  • 1,799
  • 5
  • 24
  • 43
1

Git is already tracking those files, that's why you still see them.

You should create the .gitignore BEFORE doing any commit.

You can refer to the following post if you want to untrack those files. If the project is new you could create a new repository, copy your files over and make sure you have the .gitignore file in your new repo before doing the first commit.

Community
  • 1
  • 1
mVck
  • 2,910
  • 2
  • 18
  • 20
0

This will function for me. I didn't know what was the reason. I modified my gitignore but always appeared the files I filtered. That's what i made:

  • I untracked unneccesary files-
  • Include gitignore patterns
  • Commit changes.

Actually my repository works fine.