Re: Don't share anything but those files

2012-07-17 Thread Nick Douma
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 < .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



signature.asc
Description: OpenPGP digital signature


Re: Don't share anything but those files

2012-07-16 Thread Yves Perron

Greetings everyone,

After investigation, the solution turns out to solve the problem
partially. What is does is it update any existing files/folders already
present but does not actually add new ones. So my question is, could the
content of "what to add" be edited directly? Where is the actual
registry of added files/folders to synchronize if any?


On 7/13/2012 2:08 PM, Illia Bobyr wrote:

*
!.gitignore
!a_file_that_should_be_tracked
!a_dir_to_track/


That is exactly what i was hoping for,

thank you everyone!



--


--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Don't share anything but those files

2012-07-13 Thread Yves Perron

On 7/13/2012 2:08 PM, Illia Bobyr wrote:

*
!.gitignore
!a_file_that_should_be_tracked
!a_dir_to_track/


That is exactly what i was hoping for,

thank you everyone!
--


--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Don't share anything but those files

2012-07-13 Thread Illia Bobyr
On 7/13/2012 8:21 AM, Edward Toroshchin wrote:
> On Fri, Jul 13, 2012 at 10:59:55AM -0400, Yves Perron wrote:
>> I'm wondering how to commit only selected files/folders on GIT, if even
>> possible.
> Just "git add" only the files you need.
>
> If you want git to ignore all the rest, you can write '*' in your
> .gitignore

As an alternative, you may be able to use negative patterns in your 
.gitignore or other ignore files.  Like this:

*
!.gitignore
!a_file_that_should_be_tracked
!a_dir_to_track/

See "git help ignore" for more details.

Illia Bobyr--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Don't share anything but those files

2012-07-13 Thread Taylor Hedberg
Yves Perron, Fri 2012-07-13 @ 13:40:56-0400:
> Ok, let me rephrase, is there a way to edit a file where we can put
> every files/folders we need to add without the need of entering a
> command for each entry?

Sure, but you don't need functionality built in to Git to do this. Just
list the paths you want to add in a file and then:

xargs git add 

signature.asc
Description: Digital signature


Re: Don't share anything but those files

2012-07-13 Thread Yves Perron
Ok, let me rephrase, is there a way to edit a file where we can put 
every files/folders we need to add without the need of entering a 
command for each entry?



On 7/13/2012 12:14 PM, Edward Toroshchin wrote:

On Fri, Jul 13, 2012 at 11:35:36AM -0400, Yves Perron wrote:

Oh I see, thank you for your response,

Can I put all the folders/files I want to add in a config file so I
don't have to do this every time?

Thx


You won't have to do this every time. Once you add a file and commit it,
git will track it in the future.




--

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Don't share anything but those files

2012-07-13 Thread Edward Toroshchin
On Fri, Jul 13, 2012 at 11:35:36AM -0400, Yves Perron wrote:
> Oh I see, thank you for your response,
> 
> Can I put all the folders/files I want to add in a config file so I 
> don't have to do this every time?
> 
> Thx
> 

You won't have to do this every time. Once you add a file and commit it,
git will track it in the future.

-- 
Edward "Hades" Toroshchin
dr_lepper on irc.freenode.org
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Don't share anything but those files

2012-07-13 Thread Edward Toroshchin
On Fri, Jul 13, 2012 at 10:59:55AM -0400, Yves Perron wrote:
> I'm wondering how to commit only selected files/folders on GIT, if even 
> possible.

Just "git add" only the files you need.

If you want git to ignore all the rest, you can write '*' in your
.gitignore

-- 
Edward "Hades" Toroshchin
dr_lepper on irc.freenode.org
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html