Skip to content
Discussion options

You must be logged in to vote

Hi! This is a common issue. Here is how you can fix it:

  1. Immediate Fix: Use the following command to remove the folder from the index without deleting it from your computer:
    git rm -r --cached node_modules
    git rm --cached *.log

  2. Prevention: Create or update your .gitignore file at the root of your project and add these lines:

    node_modules/
    *.log
    .DS_Store
    
  3. History Cleanup: If the files are already in your remote history, you might need to use a tool like git filter-repo or BFG Repo-Cleaner to completely scrub them from the past commits to shrink the repo size.

After doing this, commit the changes and push. Your repo will be much cleaner!

Replies: 1 comment

This comment was marked as off-topic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Question Ask and answer questions about GitHub features and usage Programming Help Discussions around programming languages, open source and software development Welcome 🎉 Used to greet and highlight first-time discussion participants. Welcome to the community! source:ui Discussions created via Community GitHub templates
2 participants