# Don't share anything but those files

2 messages from 2012-07-13 to 2012-07-17. Participants: Yves Perron, Nick Douma.
Thread: https://gitlist.dev/t/31016

## Yves Perron, 2012-07-13 14:40

Subject: Don't share anything but those files
Message-ID: <5000334C.5030505@modusfx.com>
URL: https://gitlist.dev/e/5000334C.5030505%40modusfx.com

```
Greetings everyone,

I'm wondering how to commit only selected files/folders on GIT, if even 
possible. Note, the ignore list is not a good option for me as I'd like 
to add a few files in a folder that contains many hundreds for instance.

Basically, I'm looking for a way to say, don't share anything but those 
files.

thx

```

## Nick Douma, 2012-07-17 08:37

Subject: Re: Don't share anything but those files
Message-ID: <50052448.5060407@nekoconeko.nl>
URL: https://gitlist.dev/e/50052448.5060407%40nekoconeko.nl
In-Reply-To: <5000334C.5030505@modusfx.com>

```
Hoi,

On 13-07-12 16:40, Yves Perron wrote:
> I'm wondering how to commit only selected files/folders on GIT, if even
> possible. Note, the ignore list is not a good option for me as I'd like
> to add a few files in a folder that contains many hundreds for instance.
> 
> Basically, I'm looking for a way to say, don't share anything but those
> files.

I would use a .gitignore with something like:

cat <<EOF > .gitignore
# Ignore everything
*
# Except
!/.gitignore
!/path/to/file/1
!/path/to/file/2
EOF

Only the two specified files and the .gitignore file should be shown in
`git status` now.

Kind regards,

Nick Douma


```
