I have gitolite-admin.
Some times our programmers don't use .gitignore
file and commit whole directory to the remote repo.
How can I restrict push size in git?
I tried search in git config but unsuccessfully.
I have gitolite-admin.
Some times our programmers don't use .gitignore
file and commit whole directory to the remote repo.
How can I restrict push size in git?
I tried search in git config but unsuccessfully.
It has nothing to do with git commit.
You need to set up hooks for this job.
What are some more forceful ways than a .gitignore to keep (force) files out of a repo?
Your hook will check what you want to do and then will decide if to approve the push or not.
In your hook you will have something like this:
# in the hook use this line to get the size of each file
git ls-tree -l
If you want to see the same results in your repository use this:
git ls-tree HEAD -l
How to write hooks
:Here is a nice sample how to attrack attention in hooks:
How to enforce a git commit message policy on local system to prevent pushing
You can limit by changed files amount. In your config file:
repo @all
- VREF/COUNT/50 = @all