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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T00:07:46+00:00 2026-05-25T00:07:46+00:00

I want to make an java application. This is stored on gitHub (so uses

  • 0

I want to make an java application. This is stored on gitHub (so uses git for versioning).
Now this programm uses apikeys in example from Google.
I want to hide this Api key in the versioning system (so that no one other can use it).

I’ve read something about the .gitignore file, but i don’t want to delete the whole file from versioning. I only want to hide the apiKey from others to see.

I read following thread and I think this is what I’m searching for, but I really have no idea how to do this.

Can git automatically switch between spaces and tabs?

  • 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-25T00:07:47+00:00Added an answer on May 25, 2026 at 12:07 am

    You cannot version the file and hide it from others. The ID of a commit is based in part on the ID of the commit file tree, which is based on the contents of that tree — file names and contents. If you change the contents of a file, you change its identity in Git. When you change its identity, you change the identity of the tree it’s contained in, all the way up to the commit.

    In short, no. The ID of every commit containing this file will be based upon the contents of that file. The only way to hide the file from others who will have access to the repository is to never add it to the repository in the first place.

    (If you have not yet published the repository, you can rewrite history using git filter-branch to remove all occurrences of the file. Note that this will, as described above, change the identity of many commits.)

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

Sidebar

Related Questions

I want to make a business logic of server side Java application as a
I want to make an object I can add to my java swing application.
I want to make a thread in red5 application? this thread will send data
We want to be able to create log files from our Java application which
I want to make my Java Application to call my own custom made function
My Java application uses db sessions, via Hibernate. What I want to do is
I want to make Java JDialog appear like it is presented in the image
I want to make a sort in Java. In my object I have many
I want to know how I can make a Java program where an unknown
I want to make searching on my database with hibernate in Java, how can

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.