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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T04:15:54+00:00 2026-06-14T04:15:54+00:00

This .gitignore doesn’t ignore .emacs.d .* !.emacs.d but the following does ignore it: *

  • 0

This .gitignore doesn’t ignore .emacs.d

.*
!.emacs.d

but the following does ignore it:

*  <- only change
.*
!.emacs.d

Why?

This is with git-1.7.10-x86_64

  • 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-14T04:15:55+00:00Added an answer on June 14, 2026 at 4:15 am

    I suspect that * matches the current directory in which the file .emacs.d is.
    And if a directory is ignored, git won’t look inside at all (including for negate rules exceptions).

    See, for more on that behavior:

    • “How do gitignore exclusion rules actually work?“
    • “.gitignore exclude folder but include specific subfolder“

    If you exclude aDirectory/, then everything under it will always be excluded (even if some later negative exclusion pattern (“unignore”) might match something under aDirectory/).

    The OP user273158 asks:

    How can I then exclude all files and directories (hidden or not hidden) in a given path (e.g. my home directory), except .emacs.d (and other exceptions)

    I suppose this should work better:

    ./*
    !/.emacs.d
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have read this manual: http://git-scm.com/docs/gitignore As I am working with gitosis, I rather
On some .gitignore files we may see: somedirectory/* or somedirectory/ Does this means the
When using sub-directory entries in .gitignore, git clean -X doesn't clean the ignored sub-directory.
I know about the svn:ignore property, but that doesn't solve my problem. I have
I'm trying to solve a gitignore problem on a large directory structure, but to
My .gitignore file has the following line vendor/ I have modified a file inside
I have two files I wish to ignore: .idea/workspace.xml someapp/src/.idea/workspace.xml I thought adding this
The issue: sometimes, but not every time, Git deletes the static directory of a
I have a folder foo that is included in gitignore: - .gitignore (this contains
If I put a pattern in a .gitignore file with a leading slash, does

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.