git@vger.kernel.org list mirror (unofficial, one of many)
 help / color / mirror / code / Atom feed
From: Orgad Shaneh <orgads@gmail.com>
To: git <git@vger.kernel.org>
Subject: Failure when adding a tracked file in an ignored directory
Date: Fri, 13 May 2022 10:10:22 +0300	[thread overview]
Message-ID: <CAGHpTBJDb4rv1EVvR7J9MNEgf0QnFscaf6rWG4_nOW-JnuO9FQ@mail.gmail.com> (raw)

Hi,

I have an untracked directory, but inside this directory I have some
files that I do want to track. I added these particular files with git
add -f, and committed them successfully.

The problem is that every time I update any of these files, I must use
git add -f, although the files are already tracked.

Example:
$ git init
$ mkdir foo
$ touch foo/bar
$ git add foo/bar
$ echo /foo > .gitignore
$ git add foo/bar
The following paths are ignored by one of your .gitignore files:
foo
hint: Use -f if you really want to add them.
hint: Turn this message off by running
hint: "git config advice.addIgnoredFile false"

Is this intentional? I think it should only warn and fail for *newly
added* files, but succeed silently for tracked files.

- Orgad

                 reply	other threads:[~2022-05-13  7:11 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=CAGHpTBJDb4rv1EVvR7J9MNEgf0QnFscaf6rWG4_nOW-JnuO9FQ@mail.gmail.com \
    --to=orgads@gmail.com \
    --cc=git@vger.kernel.org \
    --subject='Re: Failure when adding a tracked file in an ignored directory' \
    /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

Code repositories for project(s) associated with this inbox:

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).