Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7160785
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T13:27:20+00:00 2026-05-28T13:27:20+00:00

I really dislike to have monster .git folder (2GB) and I don’t care about

  • 0

I really dislike to have monster .git folder (2GB) and I don’t care about changes in 2002 and I don’t want to create new repository so what should I do to clean .git / log ?

Note that I want it not local-only, next time I want to clone repository without history or with history since 2011 year.

thank you

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T13:27:21+00:00Added an answer on May 28, 2026 at 1:27 pm

    From your question, I think you want something like this.

    git-rebase(1) does exactly that.

    $ git rebase -i HEAD~5
    

    git awsome-ness contains an example.

    1. Don’t use git-rebase on public (remote) commits.
    2. Make sure your working directory is clean (commit or stash your current changes).
    3. Run the above command. It launches your $EDITOR.
    4. Replace pick before C and D by squash. It will meld C and D into B. If you want to delete a commit then just delete its line.

    If you are lost, type:

    $ git rebase --abort  
    

    However, to copmress the .git folder safely, the above is not recommended. You can try the following as mentioned in a comment by Linus.

    git repack -a -d --depth=250 --window=250
    

    where that depth thing is just about how deep the delta chains can be (make them longer for old history – it’s worth the space overhead), and the window thing is about how big an object window we want each delta candidate to scan.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I really dislike PHP, but am pretty comfortable in Java. I have a stable
Really simple problem: I want to split a connection string into its keyword /
Really ripping my hair out on this one. I have a JAAS Authentication Provider
Really quick jQuery question... I have this function: $(document).ready(function() { $('a#show1').click(function() { $('.item1').toggle(1000); return
Really simple question: From within GWT I want to forward the user away from
I might be in the minority, but I really dislike how the Subversion client
I'm pretty sure I don't have any other options other than what I've uncovered,
Really newbie question: I have a .csv file that I need to read. I've
Really simple question - how do I do a search to find all records
Really stuck on trying to write code to unzip a file or directory on

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.