git-gc

Is there a way to limit the amount of memory that “git gc” uses?

柔情痞子 提交于 2019-11-27 03:21:21
I'm hosting a git repo on a shared host. My repo necessarily has a couple of very large files in it, and every time I try to run "git gc" on the repo now, my process gets killed by the shared hosting provider for using too much memory. Is there a way to limit the amount of memory that git gc can consume? My hope would be that it can trade memory usage for speed and just take a little longer to do its work. Yes, have a look at the help page for git config and look at the pack.* options, specifically pack.depth , pack.window , pack.windowMemory and pack.deltaCacheSize . It's not a totally exact

Git gc using excessive memory, unable to complete

对着背影说爱祢 提交于 2019-11-27 01:28:47
问题 Final update and fix : The solution here turned out to be a combination of two things: using Windows Git rather than Cygwin Git as Graham Borland suggested, and the Git config settings pack.threads = 1 and gc.aggressiveWindow = 150 . I have a large local Git repository, a git svn clone of an SVN repository with about 40,000 commits. I'm trying to run git gc over this repository, and getting nowhere: $ git gc --auto Auto packing the repository for optimum performance. You may also run "git gc"

How to REALLY delete a git branch (i.e. remove all of its objects/commits)?

随声附和 提交于 2019-11-27 00:44:52
问题 I have a git tree like A---B---C topic / D---E---F---G master <-- I would like to remove topic and all objects on it. I note the SHA ID of topic, then type: git branch -D topic git gc # <-- I also tried prune here... git checkout -b temp <SHA1 ID of topic> After the last command I expect to get an error (something like "Non-existent object ID..." or somth. like that). However there is no error and gitk shows the same tree structure as above?? What am I missing - I thought gc/prune are

How can I trigger garbage collection on a Git remote repository?

妖精的绣舞 提交于 2019-11-27 00:33:34
问题 As we know, we can periodically run git gc to pack objects under .git/objects . In the case of a remote central Git repository (bare or not), though, after many pushes, there many files under myproj.git/objects ; each commit seems to create a new file there. How can I pack that many files? (I mean the ones on the remote central bare repository, not on local clone repository.) 回答1: The remote repo should be configured to run gc as needed after a commit is made. See the documentation of gc.auto

Do I ever need to run git gc on a bare repo?

Deadly 提交于 2019-11-26 16:12:00
问题 man git-gc doesn't have an obvious answer in it, and I haven't had any luck with Google either (although I might have just been using the wrong search terms). I understand that you should occasionally run git gc on a local repository to prune dangling objects and compress history, among other things -- but is a shared bare repository susceptible to these same issues? If it matters, our workflow is multiple developers pulling from and pushing to a bare repository on a shared network drive. The

How often should you use git-gc?

元气小坏坏 提交于 2019-11-26 15:03:43
问题 How often should you use git-gc? The manual page simply says: Users are encouraged to run this task on a regular basis within each repository to maintain good disk space utilization and good operating performance. Are there some commands to get some object counts to find out whether it's time to gc? 回答1: It depends mostly on how much the repository is used. With one user checking in once a day and a branch/merge/etc operation once a week you probably don't need to run it more than once a year