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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T15:03:44+00:00 2026-05-16T15:03:44+00:00

this is probably naive question: i have file config.yml which is in .gitignore file

  • 0

this is probably naive question:

i have file config.yml which is in .gitignore file
when I’m switching branch to ‘someotherbranch’ and next i switch back to master

then I don’t see config.yml

why ignored files are vanishing after switching branch and what can I do to avoid it?

  • 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-16T15:03:44+00:00Added an answer on May 16, 2026 at 3:03 pm

    Files which are tracked AND ignored are treated like normal files. This usually happens if you ignore the files after you’ve added them.

    Lets say you add a file ‘ignored’, commit it, then create two branches ‘normalbranch’ and ‘removedbranch’. Then you add a .gitignore with the file ignored in the ‘normal’ branch and remove the file in the ‘ignore’ branch.

    At this point, if you merge removedbranch into normalbranch git will remove the file ‘ignored’, regardless the ‘ignore’ setting. Or to put it short: only git status cares about ‘.ignored’ files.

    You could remove the file from all branches with git rm --cached <file> to remove it from git without remove the actual file. After this point everything should work as usual

    This is btw. the way to ignore a file which is currently tracked.

    Cheers,
    Reto

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

Sidebar

Related Questions

This is probably a naive question about XmlReader , but I haven't turned up
This is probably a very naive Emacs question - I'm new to it. When
This might be a way too generic question, but what is the general approach
[Edit: This problem applies only to 32-bit systems. If your computer, your OS and
I have two questions. 1) I found a little gem of code for how
I'm writing a little desktop app that should be able to encrypt a data
When using the unmanaged API for the .NET framework to profile a .NET process
I develop a certain server. Till now, two versions could not be installed at
I'm using Mono 2.4 on the Ubiquity web hosting service. I created a simple
I am working on a simple console app to get my feet wet with

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.