git-sizer | Compute various size metrics for a Git repository, flagging those that might cause problems | Time Series Database library
kandi X-RAY | git-sizer Summary
kandi X-RAY | git-sizer Summary
Happy Git repositories are all alike; every unhappy Git repository is unhappy in its own way. —Linus Tolstoy.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of git-sizer
git-sizer Key Features
git-sizer Examples and Code Snippets
Community Discussions
Trending Discussions on git-sizer
QUESTION
Is there any way I can test how the deletion of several branches will affect the size of that git repo. I have a git repo with 10 lived branches and hundreds of feature (short lived branches).
The repo is very large and slow to clone. GitLab shows 1.4 GB as the total size, git-sizer shows a blob total size of 8.4 GB.
I have tried tools such as BFG Repo Cleaner to remove unwanted history, but I've only managed a reduction of 1.4 to 1 GB which is not really sufficient.
My strategy split my repo in 2 and also to use multiple forks to separate streams of work. I will also add push extension and size restriction in GitLab to stop pushing of junk. We've had problems with .rar, .zip, .jar files, personal backups mistakenly pushed etc. However I also want to know if I can retain the history of my long lived branches. So my questions:
- Is it possible to see how much the size would be reduced if I deleted all the short lived branches?
- Can this be achieved locally?
- Or do I just have to duplicate everything to a test repo on GitLab and delete the branches on this test repo?
ANSWER
Answered 2019-Jul-17 at 10:52Answering your three questions, I'd say that yes, it is possible to check this locally. (dependind on what you mean by if I deleted all the short lived branches, I'll assume they are not merged).
You can clone your repo, create local branches for the branches you want to keep, remove the remote, and gc aggresively.
However I don't think that'll help as much as using BGF repo cleaner to remove large binary files. If you need to track said binary files, you should switch to git-LFS for those files.
Your experience with BGF seems strange, I'd expect a much better reduction if you cleaned your repo properly.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install git-sizer
Make sure that you have the Git command-line client installed, version >= 2.6. NOTE: git-sizer invokes git commands to examine the contents of your repository, so it is required that the git command be in your PATH when you run git-sizer.
Install git-sizer. Either: a. Install a released version of git-sizer(recommended): Go to the releases page and download the ZIP file corresponding to your platform. Unzip the file. Move the executable file (git-sizer or git-sizer.exe) into your PATH. b. Build and install from source. See the instructions in docs/BUILDING.md.
Change to the directory containing a full, non-shallow clone of the Git repository that you'd like to analyze. Then run git-sizer [<option>...] No options are required. You can learn about available options by typing git-sizer -h or by reading on.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page