how to apply an older patch in local GIT repository?

How do I resolve the repository size problem with git?

  • Our repository size is increasing and git is making it difficult. I have read some by googling  and found that git is bad at maintaining binary representation of files and as the history increases this will become worst. Facebook as well moved from git to mercury. Is there a solution, quick and dirty to resolve the size issue. I am fine any solution.

  • Answer:

    I assume that most people would not need commits earlier than n commits. 1. Instead of a regular git clone, you can try a shallow clone, which goes something like: git clone --depth depth remoteurl Recent versions of git have improved support for shallow clones and you will have no problem in pulling and pushing from a shallow clone. 2. For the huge repositories that have big binary cruft committed by mistake or old assets not needed anymore a great solution is to use filter-branch. The command allows to walk through the entire history of the project filtering out, modifying, skipping files according to predefined patterns. There are already helper scripts available to http://stubbisms.wordpress.com/2009/07/10/git-script-to-show-largest-pack-objects-and-trim-your-waist-line/, so that should be easy enough. example: git filter-branch --tree-filter 'rm -rf /path/to/spurious/asset/folder' HEAD Drawback of this method is that the whole team needs to reclone the updated repository as all the commit ids have been changed, an effective rewriting of history. For projects with huge binary assets 1. sparse checkout It keeps the working directory clean by explicitly detailing which folders you want to populate. Unfortunately it does not affect the size of the overall local repository but can be helpful if you have a huge tree of folders. 2. http://caca.zoy.org/wiki/git-bigfiles It is awesome! Don't give up on Git!

Aarti Dwivedi at Quora Visit the source

Was this solution helpful to you?

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.