Closed dkrishnan7hub closed 3 weeks ago
Hey @dkrishnan7hub, that's a good question 🚀
Regarding the following statement:
... the file thats exceeding the size limit is within the .git folder .git\objects\31\c3dd7f2bf911dc68461ec6cbff002d9cce017d
The feature only blocks files above a configured size limit from being pushed to the remote repository, but doesn't prevent you from creating and committing such files locally.
In your case, you most likely created and committed such a limit exceeding file locally, and where you were trying to push it, gitness blocked it (I assume the folder you were referring to was your local clone, as the .git
folder indicates it's not a bare repo)
There's a few ways you can resolve your problem:
In case the file was committed by accident, or isn't really needed, you can remove the file to resolve the problem.
For that you'll have to remove the file from every commit in which the file exceeds the limit, which might be harder depending on how far back it is in your local commit history. In your case, it seems there's only one version of the file that's exceeding the size limit (e.g. 31c3dd7f2bf911dc68461ec6cbff002d9cce017d
)
Some useful commands:
git log --find-object=31c3dd7f2bf911dc68461ec6cbff002d9cce017d
git ls-tree -r COMMIT_SHA | grep 31c3dd7f2bf911dc68461ec6cbff002d9cce017d
git commit --amend
to update the latest commit. However, if the object was introduced further in your commit history, it can get more tricky to do manually.After you've removed ALL occurrences of the file (e.g. git log --find-object=31c3dd7f2bf911dc68461ec6cbff002d9cce017d
returns an empty response), you should then be able to push your branch without any issues.
If you can't remove the file, but it's possible to reduce it's size, you can follow the same steps as above, but instead of removing the file from ALL commits where it exceeds the limit, you'll have to update it.
If the file is necessary and can't be removed or decreased in size, you can update the max file size limit of the repository. This will only update the limit for that specific repository, other repositories will still maintain their previous limit (100MB by default).\ There's no UI support as of now, so you'll have to use the following API:
curl '{GITNESS_ENDPOINT}/api/v1/repos/{REPO_PATH}/+/settings/general' \
-H 'Authorization: XXX' \
-X PATCH \
--data '{
"file_size_limit": 1000000
}'
NOTE: limit is in Bytes, above is the default value
You can then verify the new limit has been set correctly by making the following API call:
curl '{GITNESS_ENDPOINT}/api/v1/repos/{REPO_PATH}/+/settings/general' \
-H 'Authorization: XXX'
Closing this issue for now, feel free to reopen if there's a related issue.
We are getting the following error: Changes blocked by files exceeding the file size limit
And interesting the file thats exceeding the size limit is within the .git folder
\.git\objects\31\c3dd7f2bf911dc68461ec6cbff002d9cce017d
Could you please advice how we can increase the file size limit or resolve this problem?
Thanks in advance, cheers!