Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request]: Automatically Generate .gitignore for ESP-IDF Projects (VSC-1576) #1412

Open
carun opened this issue Jan 25, 2025 · 1 comment
Assignees
Labels
Feature / Enhancement Request Request for Feature/ Enhancement

Comments

@carun
Copy link

carun commented Jan 25, 2025

Description

The ESP-IDF VS Code extension currently does not generate a .gitignore file when creating a new project. This can lead to accidental inclusion of unnecessary files (e.g., build artifacts, temporary files, or tool-specific configurations) in version control, especially for new users who might not be aware of what should or shouldn't be committed.

Suggested Improvement

Automatically create a .gitignore file as part of the project initialization process. The .gitignore file should include common exclusions for ESP-IDF projects, such as:

  • build/
  • .vscode/
  • .clangd/
  • .ccls-cache/
  • sdkconfig (optional: sdkconfig.defaults might be kept)
  • *.log, *.o
  • Other temporary or build-related files.

Benefits

  • Reduces the risk of committing unnecessary files to repositories.
  • Improves the developer experience, especially for those new to ESP-IDF and Git.
  • Ensures consistency across projects.

Sample .gitignore

# Build directories
/build/
**/build/

# ESP-IDF dependencies
/components/.idf/
**/components/.idf/
managed_components

# Project configuration
sdkconfig
sdkconfig.old

# CMake files
CMakeCache.txt
CMakeFiles/
Makefile
*.cmake

# Python environment files
*.pyc
*.pyo
*.pyd
__pycache__

# ESP32 toolchain files
.espressif/

# IDE specific files (e.g., Visual Studio Code, Eclipse)
.vscode/
.idea/
*.user
*.workspace
*.suo
*.sln

# ESP32 flash files
*.bin
*.elf
*.map

# Generated documentation
/docs/

# ESP-IDF logs
*.log
@carun carun added the Feature / Enhancement Request Request for Feature/ Enhancement label Jan 25, 2025
@github-actions github-actions bot changed the title [Feature Request]: Automatically Generate .gitignore for ESP-IDF Projects [Feature Request]: Automatically Generate .gitignore for ESP-IDF Projects (VSC-1576) Jan 25, 2025
@radurentea radurentea self-assigned this Jan 27, 2025
@SinglWolf
Copy link

SinglWolf commented Jan 29, 2025

Can also add the managed_components directory.
.DS_Store for Mac OS and .directory for Linux.
Not sure about the sdkconfig.old exception. Sometimes this file is needed for comparison with the current sdkconfig.
Also cannot be ruled out .vscode. For example, I have the VS Code user settings for the project stored there.

@radurentea radurentea assigned radurentea and unassigned radurentea Feb 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature / Enhancement Request Request for Feature/ Enhancement
Projects
None yet
Development

No branches or pull requests

3 participants