.gitignore for ROS

36 ignore rules for ROS, ready to copy into your repository.

Gitignore patterns for ROS

The complete .gitignore for ROS

# Generated by LFGitignore - https://lfgitignore.com
# Created: 2026-08-05 01:30:04 UTC
# Technologies: ROS

### ROS ###
# Build output directory
build/
devel/
# Eclipse output directory
bin/
logs/
# Library directory
lib/
msg_gen/
srv_gen/
msg/*Action.msg
msg/*ActionFeedback.msg
msg/*ActionGoal.msg
msg/*ActionResult.msg
msg/*Feedback.msg
msg/*Goal.msg
msg/*Result.msg
msg/_*.py
build_isolated/
devel_isolated/
*.cfgc
/cfg/cpp/
/cfg/*.py
*.dox
*.wikidoc
# Eclipse project file
.project
# Eclipse C/C++ project
.cproject
# CMake user settings
CMakeLists.txt.user
srv/_*.py
*.pcd
*.pyc
qtcreator-*
# User-specific settings
*.user
/planning/cfg
/planning/docs
/planning/src
# Emacs backup files
*~
# *
.
CATKIN_IGNORE

What these ROS rules actually ignore

Every pattern below, and why it belongs in your .gitignore.

General

Pattern What it ignores
build/ Build output directory
devel/ General
bin/ Eclipse output directory
logs/ General
lib/ Library directory
msg_gen/ General
srv_gen/ General
msg/*Action.msg General
msg/*ActionFeedback.msg General
msg/*ActionGoal.msg General
msg/*ActionResult.msg General
msg/*Feedback.msg General
msg/*Goal.msg General
msg/*Result.msg General
msg/_*.py General
build_isolated/ General
devel_isolated/ General

Generated by dynamic reconfigure

Pattern What it ignores
*.cfgc Generated by dynamic reconfigure
/cfg/cpp/ Generated by dynamic reconfigure
/cfg/*.py Generated by dynamic reconfigure

Ignore generated docs

Pattern What it ignores
*.dox Ignore generated docs
*.wikidoc Ignore generated docs
.project Eclipse project file
.cproject Eclipse C/C++ project
CMakeLists.txt.user CMake user settings
srv/_*.py Ignore generated docs
*.pcd Ignore generated docs
*.pyc Ignore generated docs
qtcreator-* Ignore generated docs
*.user User-specific settings
/planning/cfg Ignore generated docs
/planning/docs Ignore generated docs
/planning/src Ignore generated docs
*~ Emacs backup files

Emacs

Pattern What it ignores
. *

Catkin custom files

Pattern What it ignores
CATKIN_IGNORE Catkin custom files

How to use this .gitignore for ROS

  1. Copy the ROS rules above, or download the file directly.
  2. Create a file named .gitignore at the root of your Git repository and paste the rules into it.
  3. If some of those files are already tracked, run git rm -r --cached . then commit again — Git only applies ignore rules to untracked files.
  4. Commit the .gitignore so everyone on the team shares the same rules.

Other Other .gitignore templates

See every Other template