# git only one file

3 messages from 2009-08-25 to 2009-10-02. Participants: synhedionn, Matthias Kestenholz, gsky.
Thread: https://gitlist.dev/t/20732

## synhedionn, 2009-08-25 19:12

Subject: git only one file
Message-ID: <25140456.post@talk.nabble.com>
URL: https://gitlist.dev/e/25140456.post%40talk.nabble.com

```

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?
-- 
View this message in context: http://www.nabble.com/git-only-one-file-tp25140456p25140456.html
Sent from the git mailing list archive at Nabble.com.

```

## Matthias Kestenholz, 2009-08-25 19:38

Subject: Re: git only one file
Message-ID: <1f6632e50908251238o2fef1048uc9aa27b38f5d7689@mail.gmail.com>
URL: https://gitlist.dev/e/1f6632e50908251238o2fef1048uc9aa27b38f5d7689%40mail.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

```

## gsky, 2009-10-02 17:24

Subject: Re: git only one file
Message-ID: <25718014.post@talk.nabble.com>
URL: https://gitlist.dev/e/25718014.post%40talk.nabble.com
In-Reply-To: <25140456.post@talk.nabble.com>

```



synhedionn 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?
> 

git add /path/to/file
-- 
View this message in context: http://www.nabble.com/git-only-one-file-tp25140456p25718014.html
Sent from the git mailing list archive at Nabble.com.

```
