threads / discuss / 31016

Don't share anything but those files

Subject: Don't share anything but those files

## tl;dr

2 messages between Jul 13, 2012 and Jul 17, 2012.

replies: 1people: 2as markdown or json

Yves Perron· Jul 13, 2012, 14:40 UTC · lore
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· Jul 17, 2012, 08:37 UTC · re: Yves Perron · lore

Re: Don't share anything but those files

Hoi,
On 13-07-12 16:40, Yves Perron wrote:
Show 6 quoted lines
> 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

← back to recent threads