Yellown Yellown - 2 months ago 10x
Git Question

How to ignore temporary files

I am using GitKraken and wonder if there is a way to ignore temporary files.

I haven't found something to do this. I tried it with a .gitignore file but it didn't work.


You can format your .gitignore using patterns described below.

Exclude patterns

example.mp4    # exclude a single file named example with .mp4 extension  
*.mp4          # exclude all files with .mp4 extension  
example/       # exclude folder named example  
example/*.log  # exclude all *.log files in example folder  

After you've specified your patterns you need to commit your .gitignore

git add .gitignore
git commit -m "Added git ignore file"

If you are already tracking a file and want to untrack it

Untracking files

git rm --cached example.log

The above command will delete file example.log from tracking BUT not from your local file system.


Ignoring files