.gitignore not working


[.gitignore]
Saved/*
Intermediate/*
be added

But in GitHub Desktop, Saved/Logs/ still exists

It exists because it’s already in the repository.
Git won’t stop tracking files which are in the repository.
gitignore is used to avoid showing up non-tracked files.

3 Likes

You can remove a file from the repo and stop tracking it, in SourceTree you can do so by just clicking a file, likely similar in GH:
afbeelding

Also this is a good example why gitignore files work better as whitelists than blacklists. Less chance that things end up in the repo which don’t belong there.

If you wonder how to, here’s mine:

# First, ignore everything
*
# Now, whitelist anything that's a directory
!*/

# base files
!*.uproject
!.gitignore

# _Documentation, whitelist everything
!_Documentation/**
# Ignore OpenOffice temp files
_Documentation/**/.~lock.*

# Config
!Config/**

# Content
!Content/**
# Content Built data for maps
*_BuiltData.uasset

# Source
!Source/**

# Script
!Script/**

# Configuration files generated by the Editor
!Saved/Config/Windows/*.ini
## Config consists mostly of shared files except per-user editor settings
# Saved/Config/**/DefaultEditorPerProjectUserSettings.ini

# Plugins
!Plugins/**
Plugins/**/Intermediate/**
Plugins/**/Binaries/**

# Whitelist NVIDIA DLSS Libraries
!Plugins/NVIDIA/DLSS/Source/**/*.lib


# Whitelist PakBlacklist-<BuildConfiguration>.txt files
!Build/*/PakBlacklist*.txt
# Don't ignore icon files in Build
!Build/**/*.ico


# Cache files for the editor to use

# Art / concepts

# SourceContent, whitelist source files (software save files).
#- Blender
!SourceContent/**/*.blend
#- Photoshop
!SourceContent/**/*.psd
#- Gimp
!SourceContent/**/*.xcf
#- Audacity
!SourceContent/**/*.aup3
#- Inkscape
!SourceContent/**/*.svg

# Concepts (Stories / Art), whitelist everything
!SourceContent/_Concepts/**

3 Likes