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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T15:02:52+00:00 2026-06-10T15:02:52+00:00

I keep running into a minor inconvenience that I would like to avoid. If

  • 0

I keep running into a minor inconvenience that I would like to avoid. If I look at the set of all files I want git to ignore, I can break them into two basic groups:

  1. Files that I need to keep on my file system to work on the project (IDE project metadata files, configuration files that are particular to my workstation, etc.)

  2. Files that get generated that I don’t need and generally clutter up my file system when I add them to .gitignore. (compiled output, core dumps, etc.)

Ideally, I’d like git to ignore all these files so that when I’m looking at my unstaged changes I can get a clear view of the things I changed without a bunch of noise. If I add all those file to .gitignore I can get the clear picture of what I’ve changed when I do a git status. (this is the state I am in now)

However, I’d also like to be able to use git clean to blow away all the files in category 2 without removing all the files in category 1. If I only add the files in category 1, I can use git clean -x to remove all the untracked things. Unfortunately, that clutters up git status.

Alternatively, I can add all the files in category 2, but I end up having to manually remember not to add/commit my workstation-specific files. git status is pretty much continuously cluttered, but not quite as bad.

Is there a way I can get all three of these things in harmony:

  1. Get an clear picture of the files I care about with git status
  2. Remove all the files I don’t care about with git clean
  3. Keep all the untracked files that I don’t want to share when I run git clean
  • 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-06-10T15:02:54+00:00Added an answer on June 10, 2026 at 3:02 pm

    Have a look at the fine details of the gitignore man page. It includes details about this case.

    Choose the case you desire.


    Which file to place a pattern in depends on how the pattern is meant
    to be used. Patterns which should be version-controlled and
    distributed to other repositories via clone (i.e., files that all
    developers will want to ignore) should go into a .gitignore file.

    Patterns which are specific to a particular repository but which do
    not need to be shared with other related repositories (e.g., auxiliary
    files that live inside the repository but are specific to one user’s
    workflow) should go into the $GIT_DIR/info/exclude file.

    Patterns
    which a user wants git to ignore in all situations (e.g., backup or
    temporary files generated by the user’s editor of choice) generally go
    into a file specified by core.excludesfile in the user’s
    ~/.gitconfig.

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

Sidebar

Related Questions

This seems like it would be a simple question but I keep running into
I keep running into scenarios where I would like to provide a slightly more
Keep running into When using the multi-mapping APIs ensure you set the splitOn param
I keep running into this exception when trying to set my property phoneNumber: *
I'm trying to use git-p4 to clone perforce depot. I keep running into a
I keep running into issues with a .bat script I want to write to
I keep running into all sorts of nuances between the web site project versus
Hello I keep running into errors and outputs that say undefined in my output
I'm refactoring some legacy code, and I keep running into this Object. I would
I keep running into this. I want to spawn processes and pass arguments to

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.