git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: How to add folder NON RECURSIVELY ?

From
JBJ. Bakshi <joydeep.bakshi@infoservices.in>
Date
Apr 4, 2012, 06:52 UTC
Message-ID
<201204040652.q346qaC8020941@VM-MailSafe-02.soltecsis.com>
In-Reply-To
<vpqaa2tc5xi.fsf@bauges.imag.fr>

On Tue, 03 Apr 2012 15:15:37 +0200 Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> wrote:

Show 17 quoted lines
> "J. Bakshi" <joydeep.bakshi@infoservices.in> writes:
> 
> > Could you please suggest how can I add foo/dir1/file1 ?
> >
> > guess
> >
> > touch foo/dir1/.gitignore
> > git add foo/dir1/
> 
> Not if you want only "file1" to be added. As I said, Git doesn't know
> and doesn't want to know about directories. So "git add directory/" is
> just a shorthand that adds all (non-ignored) files in this directory.
> 
> > git add foo/dir1/file1
> 
> This last line alone will do it.
> 
Thanks a lot to all of you for your valuable suggestion.
Previous: Matthieu Moy
Message 6 of 6 in “How to add folder NON RECURSIVELY ?”
  1. J. BakshiApr 3, 2012
  2. Matthieu MoyApr 3, 2012
  3. J. BakshiApr 3, 2012
  4. Dirk SüsserottApr 3, 2012
  5. Matthieu MoyApr 3, 2012
  6. J. BakshiApr 4, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.