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 577711
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T14:10:58+00:00 2026-05-13T14:10:58+00:00

At first: This is (hopefully) no duplicate of this or this . The current

  • 0

At first: This is (hopefully) no duplicate of this or this.

The current status: I committed a file with credentials for an internal database to my Git repository. This was fine, as I used it only alone. Then my group started to clone, push and pull around in this project. We now have several Git repositories (one central and some developers).

The problem: We now want to give public access to the source code, and to the Git repository or at least let Git manage the details of others contributing to the code.

The question: What would be a good strategy to

a) remove the file with the credentials from the central or from all repositories, or

b) set up a new Git repository as kind of ‘interface’ to the outer world?

If choosing (b), how could we easily communicate changes back to the main repository?

Due to the already widespread distribution, we’d really like to not do a git rebase or a git filter-branch on each and every current repository.

  • 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-13T14:10:58+00:00Added an answer on May 13, 2026 at 2:10 pm

    Sorry, but you’re stuck with running git filter-branch if you want to delete the credentials from the main repository. See Removing sensitive data, written by the folks at GitHub.

    Due to git’s design, there’s no way to force existing clones to delete the file from their respective histories.

    You could sanitize a single branch and make it the basis for future development:

    $ git checkout -b old-master master
    $ git filter-branch ... master
    

    Now you’d need to push the sanitized master to a new repo that contains only the clean master:

    $ git push new-central master
    

    Existing repos can add the new remote and git cherry-pick changes from their old branches over to the new clean master if necessary.

    For the new repository, put some sort of barrier in place to prevent someone pushing sensitive data to it so you don’t have the same problem all over again. This barrier might be a human being who controls the new central repository and reviews all patches to decide what goes in.

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

Sidebar

Related Questions

I'm new to Java and this is my first post on here so hopefully
(At first glance this may look like a duplicate of Different execution plan when
Possible Duplicate: Foursquare API for venue user image error I first noticed this problem
Hopefully this is a straightforward question... Here's my process to reproduce this issue. First
Hopefully this is an appropriate question... I'm playing around with WPF for the first
Good morning, all. This is my first question on stackoverflow, so hopefully this isn't
first time posting, hopefully this will be helpful to others too. I've found a
This is my first time posting on stackoverflow, so hopefully this is observing all
Code first: '''this is main structure of my program''' from twisted.web import http from
In linking a sports event to two teams, at first this seemed to make

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.