Skip to content

Fix: Add .next/ to .gitignore and remove from Git tracking#75

Open
Copilot wants to merge 4 commits into
mainfrom
copilot/fix-3abd8b88-d3f9-49b6-b89b-e5084e9b3e6c
Open

Fix: Add .next/ to .gitignore and remove from Git tracking#75
Copilot wants to merge 4 commits into
mainfrom
copilot/fix-3abd8b88-d3f9-49b6-b89b-e5084e9b3e6c

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Aug 19, 2025

Problem

The .next/ directory generated by Next.js during builds was not properly ignored by Git, causing build artifacts like .next/BUILD_ID to be accidentally committed to the repository. The existing .gitignore only included apps/web/.next/ but not the root-level .next/ directory that Next.js creates during the build process.

Solution

This PR fixes the issue by:

  1. Adding .next/ to .gitignore: Updated the root .gitignore file to properly ignore the entire .next/ directory generated at the project root
  2. Removing tracked files: Used git rm -r --cached .next to remove all 47 previously tracked build artifact files from Git history
  3. Additional Next.js files: Also added next-env.d.ts and out/ to .gitignore for completeness

Verification

The fix has been thoroughly tested:

# Build creates .next directory with BUILD_ID file
npm run build
ls .next/BUILD_ID  # ✅ File exists

# Git properly ignores the entire directory
git status  # ✅ No .next files shown as untracked
git check-ignore .next/BUILD_ID  # ✅ Returns .next/BUILD_ID (properly ignored)

Impact

  • Prevents future issues: The .next/BUILD_ID file and all other build artifacts will no longer be accidentally committed
  • Clean repository: Removes 47 build artifact files that were previously tracked
  • Standard practice: Aligns with Next.js best practices for .gitignore configuration

This resolves the specific issue where the .next/BUILD_ID file was causing problems in pull requests due to being tracked by Git when it should be ignored as a build artifact.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • fonts.googleapis.com
    • Triggering command: node /home/REDACTED/work/LaVidaLuca-App/LaVidaLuca-App/node_modules/.bin/next build (dns block)

If you need me to access, download, or install something from one of these locations, you can either:


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@vercel
Copy link
Copy Markdown

vercel Bot commented Aug 19, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
la-vida-luca-app Ready Ready Preview Comment Aug 19, 2025 6:27pm
la-vida-luca-app-zd4o Ready Ready Preview Comment Aug 19, 2025 6:27pm

Copilot AI and others added 2 commits August 19, 2025 18:19
Co-authored-by: vidaluca77-cloud <226796821+vidaluca77-cloud@users.noreply.github.com>
Co-authored-by: vidaluca77-cloud <226796821+vidaluca77-cloud@users.noreply.github.com>
Co-authored-by: vidaluca77-cloud <226796821+vidaluca77-cloud@users.noreply.github.com>
Copilot AI changed the title [WIP] Ajout de .next/ au .gitignore et suppression du suivi git du dossier .next Fix: Add .next/ to .gitignore and remove from Git tracking Aug 19, 2025
Copilot AI requested a review from vidaluca77-cloud August 19, 2025 18:27
@vidaluca77-cloud vidaluca77-cloud marked this pull request as ready for review August 19, 2025 20:16
Copilot AI review requested due to automatic review settings August 19, 2025 20:16
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review any files in this pull request.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants