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

  • Home
  • SEARCH
  • 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 7441549
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T11:02:01+00:00 2026-05-29T11:02:01+00:00

Is there a way to hide commits from certain users? I want to make

  • 0

Is there a way to hide commits from certain users? I want to make a private repo public but don’t want people to see all of my old commits. Some of them have passwords and API keys. Others are just plain irrelevant to what I want to provide.

The private repo is currently hosted on GitHub. I want to flip the switch and make it Public and Open Source, but that would reveal the old commits I don’t want people to see.

I know that one way I could go about this is to create an entirely new repository, but I’ve reached the repo limit for my account. Looking for the fastest and easiest way to solve the problem. Open to whatever approach works — including creating a new repo, if that happens to be the best way.

  • 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-29T11:02:02+00:00Added an answer on May 29, 2026 at 11:02 am

    If you do indeed “hide” those commits, then you’re effectively creating a new repo. A commit’s SHA1 depends on all of its content, and upon its parents, so changing a single commit changes everything afterward.

    If the scope of things to hide is enormous, you may be best off not exporting any history. But hopefully things are fairly isolated, and you can solve your problems with git filter-branch. The manpage describes its capabilities pretty well, including a few toy examples (for example how to remove files from history), and there are a lot more examples online, including here. You might end up making multiple passes, e.g. one to remove certain files, and one to remove certain types of commits.

    The key things that might be useful to you:

    • --index-filter will let you remove or rename a given set of files or directories – it only lets you modify the index, without checking out the files, so it’s fast;

    • --env-filter will let you very rapidly rewrite author/committer information; and

    • --tree-filter, the last resort, will actually check out the entire tree at each step, and let you modify files in-place (e.g. search and replace to remove passwords)

    filter-branch completely rewrites all history on any refs you specify, and leaves the original refs in refs/originals in case you need them. For a variety of reasons, not the least of which is safety, it’s best to use it in a fresh clone.

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

Sidebar

Related Questions

Is there any way to hide or encrypt JavaScript code to prevent people from
Is there a way to hide a form from my users until they click
Is there a way to hide my drupal site from the googlebots? I don't
Is there a way to hide date and user info from a page post
Is there a way to hide the windows command prompt or prevent it from
Is there any way to hide protocol conforming from an end user? I'll try
Is there any way to hide a C# program from the Windows Task Manager?
Is there any way to hide the http requests a java application makes from
Is there a way to hide private data members of a C++ class away
Is there a way to hide commenting in my php/html file? I want to

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.