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 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

Ask A Question

Stats

  • Questions 300k
  • Answers 300k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer listall | shuf | head -n 1 May 13, 2026 at 8:03 pm
  • Editorial Team
    Editorial Team added an answer You could add a boolean dirty; flag to the bean,… May 13, 2026 at 8:03 pm
  • Editorial Team
    Editorial Team added an answer I'd say no. Why not just build it in VC6? May 13, 2026 at 8:03 pm

Related Questions

Is it possible to have 2 git repositories in one directory? I'd think not,
I have a logging table on the master server that is inserted into very
What is the best (or as good as possible) general SVN ignore pattern to
I would like to delete/change some file in my local SVN repository and then
Some background: As a personal project, I've been developing a kernel in c++. Things

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.