[git][windows] Preventing local file bloat #23027
-
I’m using GitHub Desktop and git.exe for my repo and am running into an issue. Over time the local repos folder bloats out to over 500MB for a remote repo that is under 11MB. I have a PowerShell script that runs the following commands:
I’m trying to get it to:
for both remote and local. Any ideas? |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments
-
to get only the last commit? No, that’s not right I think. I know that “git clone” has a --depth option to get a limited history. |
Beta Was this translation helpful? Give feedback.
-
It sounds like you’re using git for something that it wasn’t designed for. I suspect that you have a lot of binary files in the repository, files such as audio, image, or video files. And then on top of that, you’re intentionally not using any of the version control features of git, using it only as a remote file storage mechanism. Unfortunately, it’s not possible to tell git to work in such a way. It’s going to assume that you’re trying to use it as a version control system and keep extra data around in case you decide to refer back to it. You could look into the I hope that helps! |
Beta Was this translation helpful? Give feedback.
-
Potentially useful article about using git-sizer to determine how your repository is “too big”. Also, is 500M “size” or “allocated size”? I have a 5M repo which occupies 75M of disk space on one device - each of many 1K files occupies 128K of allocated disk space. |
Beta Was this translation helpful? Give feedback.
-
Thanks everyone for the replies 😃 To prevent bloat I’ve decided to just delete the local repo folder and clone down the repo after every 20 commits. |
Beta Was this translation helpful? Give feedback.
Thanks everyone for the replies 😃
To prevent bloat I’ve decided to just delete the local repo folder and clone down the repo after every 20 commits.