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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T08:25:57+00:00 2026-05-13T08:25:57+00:00

Is it possible to ignore specific files in git only for certain remotes? e.g.,

  • 0

Is it possible to ignore specific files in git only for certain remotes? e.g., I’m storing AWS S3 credentials (s3.yml) in a file for an app hosted on Heroku, thus I need to check s3.yml into my repo for the deploy to work. However, I’d like to publish the source to GitHub as well, so I would be wise to keep s3.yml out of the repo. I would imagine it working something like

#.gitignore
github:config/s3.yml

but haven’t been able to find anything in the git docs. Is this possible? Or do I need to maintain two separate repos?

Thanks!

  • 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-13T08:25:57+00:00Added an answer on May 13, 2026 at 8:25 am

    That file is always going to live in the repo if you publish it as is. Even if you created a branch and git-rm’d the file, people would always be able to check out the version that still had the file. I don’t see any way of using a single repository while keeping a single file inaccessible on a remote.

    The core problem is that, as a distributed SCM, each repository has a full revision history. Since the changelists are cryptographically signed based on their content, it’s not possible to erase a file without changing the hash of each changelist all the way back to when the file was added. This is something git can do, but at that point you have two separate repositories that won’t be able to directly/easily push/pull.

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

Sidebar

Related Questions

Is it possible using Cobertura to tell it to ignore certain bits of code
What is the best (or as good as possible) general SVN ignore pattern to
I have some thread-related questions, assuming the following code. Please ignore the possible inefficiency
Possible Duplicate: How do you send email from a Java app using Gmail? How
Is it possible to have 2 git repositories in one directory? I'd think not,
I know using below code to ignore a certain exception, but how to let
Is it possible that the opera browser ignore the keyCode 40 (arrow down)? $('#test').keyup(function(e)
Is it possible to implement the 'not-found=ignore' behaviour of NHibernate on a key mapping
Possible Duplicate: Why not use tables for layout in HTML? Under what conditions should
Possible Duplicate: NAnt or MSBuild, which one to choose and when? What is the

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.