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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T01:33:08+00:00 2026-06-10T01:33:08+00:00

i am sure *.lib is in .gitignore cat .gitignore | grep lib *.lib $

  • 0

i am sure *.lib is in .gitignore

cat .gitignore | grep lib
*.lib

$ ls lib
TLib.lib  TLib_d.lib


$ git status
# On branch master
nothing to commit (working directory clean)


$ git clean -dfX

$ ls lib
TLib.lib  TLib_d.lib     // the issue is here...

why these .lib files are not deleted?

  • 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-10T01:33:10+00:00Added an answer on June 10, 2026 at 1:33 am

    Git stops searching files, once it encounters a directory not in the index. But in the case above, we are telling git to search all files matching ignore pattern. So, it’d better go in to all directories and search files.

    This will also match git ls-files behavior. Given:

    $ tree
    .
    ├── foo.o
    └── lib
        ├── TLib_d.lib
        └── TLib.lib
    
    1 directory, 3 files
    
    $ cat .gitignore
    *.lib
    

    Run following commands.

    $ git ls-files -o
    foo.o
    lib/TLib.lib
    lib/TLib_d.lib
    
    $ git ls-files -o -i --exclude-standard
    lib/TLib.lib
    lib/TLib_d.lib
    
    $ git clean -n
    Would remove foo.o
    Would not remove lib/
    
    $ git clean -nd
    Would remove foo.o
    Would remove lib/
    
    $ git clean -nX
    

    The last command does not print any files. But it would be nice if it did:

    $ git clean -nX
    Would not remove foo.o
    Would not remove lib/
    Would remove lib/TLib.lib
    Would remove lib/TLib_d.lib
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm not sure what I'm doing wrong here, I have a file in lib/acts_as_votable.rb
I'm having trouble using one Lua lib from inside another. I'm not sure about
I'm not sure what's going on here. Using MiniMagick 3.3, everything was working fine
The following Makefile is not working and I am not sure what's going on.
I've got some code in the lib/ directory that don't really belong under controls,
I'm not sure why is this. I'm distributing a static *.lib across multiple projects,
I'm sure that there is nothing wrong with my project. Because I have tried
I am working on project in Linux which involves 1) Static Lib in C++
Ok so I am using some module/lib/plugin (not sure of the exact name), let's
I'm not sure why this particular lib is giving me trouble when others do

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.