.gitignore for Linux
6 ignore rules for Linux, ready to copy into your repository.
Linux operating system
The complete .gitignore for Linux
# Generated by LFGitignore - https://lfgitignore.com
# Created: 2026-02-09 07:29:27 UTC
# Technologies: Linux
### Linux ###
# Emacs backup files
*~
.fuse_hidden*
# Linux folder settings
.directory
# Linux trash folder
.Trash-*
.nfs*
nohup.out
What these Linux rules actually ignore
Every pattern below, and why it belongs in your .gitignore.
General
| Pattern | What it ignores |
|---|---|
*~ |
Emacs backup files |
.fuse_hidden* |
temporary files which can be created if a process still has a handle open of a deleted file |
Metadata left by Dolphin file manager, which comes with KDE Plasma
| Pattern | What it ignores |
|---|---|
.directory |
Linux folder settings |
Linux trash folder which might appear on any partition or disk
| Pattern | What it ignores |
|---|---|
.Trash-* |
Linux trash folder |
.nfs* |
.nfs files are created when an open file is removed but is still being accessed |
Log files created by default by the nohup command
| Pattern | What it ignores |
|---|---|
nohup.out |
Log files created by default by the nohup command |
How to use this .gitignore for Linux
- Copy the Linux rules above, or download the file directly.
- Create a file named .gitignore at the root of your Git repository and paste the rules into it.
- If some of those files are already tracked, run git rm -r --cached . then commit again — Git only applies ignore rules to untracked files.
- Commit the .gitignore so everyone on the team shares the same rules.