9/5/2023 0 Comments Git undo commit file too bigIf you already tried and failed to push then reset the last commit and try again. Here are a couple things you can do to avoid the following error when trying to push a large commit: remote: fatal: pack exceeds maximum allowed size. Avoiding large commitsĪs mentioned above, we recommend repositories be kept under 2.0 GB to help ensure that our servers are fast and downloads are quick for our users. Once large files have been removed, it is a best practice for everyone using the repository to make a new clone otherwise, if someone does a force push, they will push the large files again and you’ll be back to where you started. If you want to keep a lot of large files without paying for extra LFS storage you’ll need to put them elsewhere see Options for storing large files below for a few of the available options. Use BFG to migrate a repo to Git LFS – how to make use of the Git LFS in your plan. Maintaining a Git repository – how to remove large files from a Git repository. Below are some resources to help you maintain your Git repository and provide more information about using Git LFS. Once pushes are unblocked, you can go ahead and remove large files from the repository. After you remove any large files, you will need to contact our Support team to run GC for you and reduce your repository size. If your repository size is not reduced after taking these steps, it may mean that you need to remove any large files in order to rewrite history. What can I do if my repository size was not reduced after following the above steps? Once that’s done pushes will work again, so you can go ahead and reduce the repository size to below the 2.0 GB limit by removing large files see Removing large files below. This process is assuming that the bad commit is only on one branch and hasn’t been merged to other branches. Rewind the branch containing the bad commit to just before that commit. To remove large files you need to rewrite history otherwise, Git just keeps the large files in the history. This will bring the size below the 4.0 GB limit and remove the push restriction, allowing you to perform maintenance on the repository. To continue making changes you’ll need to undo the last commit see Undoing the last push below. The warning message is displayed following the first push attempted after the repository has exceeded the 4 GB limit. ! main -> main (pre-receive hook declined) Remote: Learn how to reduce your repository size. Remote: Repository is over the size limit (4 GB) and will not accept further additions.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |