git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alex Riesen <raa.lkml@gmail.com>
To: mwolfe38 <mwolfe38@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: ignoring files/directories in git
Date: Sun, 21 Sep 2008 19:20:48 +0200	[thread overview]
Message-ID: <20080921172048.GA3877@blimp.localhost> (raw)
In-Reply-To: <19596152.post@talk.nabble.com>

mwolfe38, Sun, Sep 21, 2008 18:54:01 +0200:
> In my project I have several directories I do not want to have git ignore.
> One of them being
> cache/ and the other log/
> I've added them to the .gitignore file which I have in the initial directory
> of the repository
> The contents of my gitignore are:
> 
> .settings
> .cache
> cache/
> log/
> .project
> 
> However, if I do 
> git add .
> It will add the files from cache and log anyways.
> I know git add . will add anything that hasn't been added but shouldn't it
> ignore files in .gitignore?

It should and indeed it does ignore them:

    $ mkdir ggg && cd ggg
    $ git init
    Initialized empty Git repository in /tmp/ggg/.git/
    $ >a
    $ mkdir cache log
    $ touch cache/b
    $ touch log/c
    $ echo cache/ >.gitignore
    $ echo log/ >>.gitignore
    $ cat .gitignore
    cache
    log
    $ git add .
    $ git ls-files
    .gitignore
    a

What is your git version and where have you got it from?
Is your .gitignore written exactly like this (case, some hidden
extension, like they do on Windows)? Any invisible characters in
.gitignore?

  parent reply	other threads:[~2008-09-22 17:56 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-21 16:54 ignoring files/directories in git mwolfe38
2008-09-21 17:19 ` Boaz Harrosh
2008-09-21 17:20 ` Alex Riesen [this message]
2008-09-21 17:42 ` mwolfe38
2008-09-22 18:47   ` Tim Harper
2008-09-21 17:42 ` Dmitry Potapov
2008-09-22  0:06 ` mwolfe38
2008-09-22  7:37   ` Boaz Harrosh
2008-09-22  8:52     ` Dmitry Potapov
2008-09-22 10:41       ` Boaz Harrosh
2008-09-22 11:53         ` Andreas Ericsson
2008-09-22 12:19         ` Dmitry Potapov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080921172048.GA3877@blimp.localhost \
    --to=raa.lkml@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=mwolfe38@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).