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

Re: git only one file

From
Matthias Kestenholz <mk@feinheit.ch>
Date
Aug 25, 2009, 19:38 UTC
Message-ID
<1f6632e50908251238o2fef1048uc9aa27b38f5d7689@mail.gmail.com>
In-Reply-To
<25140456.post@talk.nabble.com>
On Tue, Aug 25, 2009 at 9:12 PM, synhedionn<synhedionn@gmail.com> wrote:
>
> with git add .  , a directory is expected, but I don't need all my files to
> be recorded, only one of my thousands, so how can I record just 1 file?

By only adding this file to the index. Use "git add $yourfile" instead of "git add ."

If you do not want to see your thousands of files in the directory
when running git status, you can simply create a .gitignore file with
* as content. Git will still notify you about files which it already
knows about, even though the .gitignore entry tells it to ignore
everything.
Matthias
Previous: synhedionnNext: gsky
Message 2 of 3 in “git only one file”
  1. synhedionnAug 25, 2009
  2. Matthias KestenholzAug 25, 2009
  3. gskyOct 2, 2009

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.