git@vger.kernel.org list mirror (unofficial, one of many)
 help / color / mirror / code / Atom feed
* Failure when adding a tracked file in an ignored directory
@ 2022-05-13  7:10 Orgad Shaneh
  0 siblings, 0 replies; only message in thread
From: Orgad Shaneh @ 2022-05-13  7:10 UTC (permalink / raw)
  To: git

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-05-13  7:11 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-13  7:10 Failure when adding a tracked file in an ignored directory Orgad Shaneh

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).