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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T06:00:06+00:00 2026-05-27T06:00:06+00:00

Along the code there could be very sensitive information such as passwords, amazon s3

  • 0

Along the code there could be very sensitive information such as passwords, amazon s3 keys, etc that I don’t want to be sent to git at all.

I’d like those very specific fields to either be replaced with “SECRET” or something like that.
Also, is git private repo solving this?

  • 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-27T06:00:07+00:00Added an answer on May 27, 2026 at 6:00 am

    Since git tracks text and not just files, replacing these lines with some other text would be interpreted by git as a change on the code, so it would overwrite the original sensitive info in the next commit.

    What I use to do in these cases is to modularize my code so this info get isolated in a single file, and then I add a line with the file name to the .gitignore file.

    The .gitignore file is a collection of patterns, one per line, of file names to be ignored by git while tracking changes in your repo.

    For example, if I’m writing a web system in php, I create a file that only store info about credentials for connecting to the database (frameworks use to do so too, so you could guess it’s a good practice…). So I write this file once with the test server credentials (which my collaborators are supposed to know) or with some dummy credentials, commit it and push it to my remote, and then I add the file name to my .gitignore.

    In the other hand, you have the command git add -p, which interactively let you skip lines, but that would result on a file without the mentioned lines in your remote repo, an you having to manually skip the lines every time you add the file…

    A Good reference for git is Progit. Highly recommended if you are starting with git… Also, Github’s help center is a very good place to look.

    I hope it would be helpful! good luck!!!

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

Sidebar

Related Questions

Are there tools out there which could automatically find copy-and-paste code among a set
I'm guessing the StackOverflow code has something along the lines of a UsersController that
As always, I would appreciate very much if somebody out there could help me
There is a very similar question already. One of the solutions uses code like
I was trying to code along with the PDC2008 Intro to F# video .
Has anyone implemented the Enterprise Library VAB along wtih Code Contracts in .NET 4.0?
I recently came along this line of code: CustomData_em_free_block(&em->vdata, &eve->data); And I thought, isn't:
Does Ruby have any tools along the lines of pylint for analyzing source code
So while rewriting some code, I came across something along the lines of: Method
I'm building a project along with a Dll. The Dll must support native code

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.