Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/takanotume24/git-tools
Script to check the size of files to be git committed
https://github.com/takanotume24/git-tools
Last synced: 10 days ago
JSON representation
Script to check the size of files to be git committed
- Host: GitHub
- URL: https://github.com/takanotume24/git-tools
- Owner: takanotume24
- Created: 2024-01-18T14:23:11.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2024-08-02T07:24:43.000Z (6 months ago)
- Last Synced: 2024-11-22T15:33:27.038Z (2 months ago)
- Language: Shell
- Homepage:
- Size: 9.77 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## `check_file_size.sh`
Check the size of the file that was the subject of the Git commit.
If you commit a large file, you may run into the following problems
- GitHub and other Git repository hosting services set a limit on the size of files tracked by Git. If a large file is included, it will be rejected during push.
- The Git repository may become bloated, causing Git commands to run slower and the .git directory to become huge.## Installation
1. Clone this repository to any location.```
$ git clone [email protected]:takanotume24/git-tools.git
```
1. Move to a Git repository that requires a file size check.
```
$ cd target_git_repository
```1. Edit `.git/hooks/pre-commit` and include the following.
```bash
#!/bin/bash
"${HOME}/git-tools/bin/check_file_size.sh"
```## Usage
Run `git commit`. If the size of the file to be committed is too large, it will show an error and abort the commit.