Large files found
Instructions on resolving error related to large files
When pushing your changes, you might see a message indicating that some files exceed the 1MB size limit:
If you encounter an error like this, it’s likely due to inadvertently committing files that are too large or not meant to be tracked (e.g., binaries or node_modules/
).
Depending on when these large files entered your Git history, there are two ways to resolve this.
Solution 1: Amend last commit (Try this first)
Stage the large files for deletion
Run the following command:
This command removes the large files from your Git repository and locally.
For example to delete the ./server
and ./release/target
binaries shown in the screenshot above, run the following command:
Commit the changes
This will amend the previous commit with the changes.
Push the code
Finally, push your code:
If Solution 1 doesn’t work, it means the large files are present in an older commit and will require some extra work. Follow the instructions in Solution 2 below.
Solution 2: Amend historical commits
Install `git repo-filter`
You can install git-filter-repo manually or by using a package manager. For example, to install the tool with Homebrew, run the following command:
For more information, see INSTALL.md
Delete the large files
Delete each of the large files using the following command:
This will remove the file from your Git history and local filesystem.
Restore your remotes and push
The git filter-repo
tool will automatically remove your configured remote CodeCrafters Git repository. Restore it using the following steps:
Copy the CodeCrafters Git repository URL from the dropdown menu:
Run the following command in your local project folder:
Finally, force-push your code:
If you’re still running into issues after trying the the two steps above, please reach out to us at hello@codecrafters.io and we’ll help out!
Was this page helpful?