Skip to content

fix: Add .next/ to .gitignore and remove Next.js build files from git tracking#74

Open
Copilot wants to merge 3 commits into
mainfrom
copilot/fix-30506908-50fc-4947-a707-6c147812724b
Open

fix: Add .next/ to .gitignore and remove Next.js build files from git tracking#74
Copilot wants to merge 3 commits into
mainfrom
copilot/fix-30506908-50fc-4947-a707-6c147812724b

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Aug 19, 2025

Problem

The .next/ directory was not properly ignored by git, causing Next.js build artifacts to be tracked in version control. This led to issues with the BUILD_ID file and other automatically generated files appearing in pull requests, which should not happen since these files are generated during the build process.

Solution

This PR fixes the issue by:

  1. Adding .next/ to the root .gitignore - Ensures all Next.js build artifacts are ignored by git
  2. Removing existing .next/ files from git tracking - Used git rm -r --cached .next to untrack previously committed build files

Changes Made

  • Modified .gitignore to include .next/ at the root level
  • Removed 47 build artifact files that were previously tracked in the .next/ directory
  • The .next/ directory still exists locally for development but is now properly ignored by git

Verification

After these changes:

  • git status shows clean working tree
  • ✅ No .next/ files are tracked by git (git ls-files | grep .next returns empty)
  • ✅ New files added to .next/ directory are automatically ignored
  • ✅ The local .next/ directory remains intact for Next.js functionality

This ensures that future builds will not pollute the git history with automatically generated files, and the BUILD_ID deletion issue mentioned in the original problem will not occur again.

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:


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@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:13pm
la-vida-luca-app-zd4o Canceled Canceled Aug 19, 2025 6:13pm

Copilot AI and others added 2 commits August 19, 2025 18:09
Co-authored-by: vidaluca77-cloud <226796821+vidaluca77-cloud@users.noreply.github.com>
… tracking

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 Next.js build files from git tracking Aug 19, 2025
Copilot AI requested a review from vidaluca77-cloud August 19, 2025 18:12
@vidaluca77-cloud vidaluca77-cloud marked this pull request as ready for review August 19, 2025 22:33
Copilot AI review requested due to automatic review settings August 19, 2025 22:33
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