All of lore.kernel.org
 help / color / mirror / Atom feed
* Don't share anything but those files
@ 2012-07-13 14:59 Yves Perron
  2012-07-13 15:21 ` Edward Toroshchin
  0 siblings, 1 reply; 10+ messages in thread
From: Yves Perron @ 2012-07-13 14:59 UTC (permalink / raw)
  To: git

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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Don't share anything but those files
  2012-07-13 14:59 Don't share anything but those files Yves Perron
@ 2012-07-13 15:21 ` Edward Toroshchin
       [not found]   ` <50004048.9060203@modusfx.com>
  2012-07-13 18:08   ` Illia Bobyr
  0 siblings, 2 replies; 10+ messages in thread
From: Edward Toroshchin @ 2012-07-13 15:21 UTC (permalink / raw)
  To: Yves Perron, git

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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Don't share anything but those files
       [not found]   ` <50004048.9060203@modusfx.com>
@ 2012-07-13 16:14     ` Edward Toroshchin
  2012-07-13 17:40       ` Yves Perron
  0 siblings, 1 reply; 10+ messages in thread
From: Edward Toroshchin @ 2012-07-13 16:14 UTC (permalink / raw)
  To: Yves Perron, git

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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Don't share anything but those files
  2012-07-13 16:14     ` Edward Toroshchin
@ 2012-07-13 17:40       ` Yves Perron
  2012-07-13 17:53         ` Taylor Hedberg
  0 siblings, 1 reply; 10+ messages in thread
From: Yves Perron @ 2012-07-13 17:40 UTC (permalink / raw)
  To: Edward Toroshchin; +Cc: git

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.
>


--

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Don't share anything but those files
  2012-07-13 17:40       ` Yves Perron
@ 2012-07-13 17:53         ` Taylor Hedberg
  0 siblings, 0 replies; 10+ messages in thread
From: Taylor Hedberg @ 2012-07-13 17:53 UTC (permalink / raw)
  To: Yves Perron; +Cc: Edward Toroshchin, git

[-- Attachment #1: Type: text/plain, Size: 556 bytes --]

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 <filename

But you only have to do this once, so I'm not really sure what that buys
you.

You can use glob patterns to select groups of files to add as well, if
there is some similarity in the pathnames.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Don't share anything but those files
  2012-07-13 15:21 ` Edward Toroshchin
       [not found]   ` <50004048.9060203@modusfx.com>
@ 2012-07-13 18:08   ` Illia Bobyr
  2012-07-13 18:19     ` Yves Perron
  1 sibling, 1 reply; 10+ messages in thread
From: Illia Bobyr @ 2012-07-13 18:08 UTC (permalink / raw)
  To: Edward Toroshchin; +Cc: Yves Perron, git

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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Don't share anything but those files
  2012-07-13 18:08   ` Illia Bobyr
@ 2012-07-13 18:19     ` Yves Perron
  2012-07-16 14:26       ` Yves Perron
  0 siblings, 1 reply; 10+ messages in thread
From: Yves Perron @ 2012-07-13 18:19 UTC (permalink / raw)
  To: Illia Bobyr; +Cc: Edward Toroshchin, git

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!
-- 

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Don't share anything but those files
  2012-07-13 18:19     ` Yves Perron
@ 2012-07-16 14:26       ` Yves Perron
  0 siblings, 0 replies; 10+ messages in thread
From: Yves Perron @ 2012-07-16 14:26 UTC (permalink / raw)
  To: git

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!


-- 

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Don't share anything but those files
  2012-07-13 14:40 Yves Perron
@ 2012-07-17  8:37 ` Nick Douma
  0 siblings, 0 replies; 10+ messages in thread
From: Nick Douma @ 2012-07-17  8:37 UTC (permalink / raw)
  To: Yves Perron; +Cc: git

[-- Attachment #1: Type: text/plain, Size: 653 bytes --]

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


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 262 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Don't share anything but those files
@ 2012-07-13 14:40 Yves Perron
  2012-07-17  8:37 ` Nick Douma
  0 siblings, 1 reply; 10+ messages in thread
From: Yves Perron @ 2012-07-13 14:40 UTC (permalink / raw)
  To: git

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

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2012-07-17  8:37 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-13 14:59 Don't share anything but those files Yves Perron
2012-07-13 15:21 ` Edward Toroshchin
     [not found]   ` <50004048.9060203@modusfx.com>
2012-07-13 16:14     ` Edward Toroshchin
2012-07-13 17:40       ` Yves Perron
2012-07-13 17:53         ` Taylor Hedberg
2012-07-13 18:08   ` Illia Bobyr
2012-07-13 18:19     ` Yves Perron
2012-07-16 14:26       ` Yves Perron
  -- strict thread matches above, loose matches on Subject: below --
2012-07-13 14:40 Yves Perron
2012-07-17  8:37 ` Nick Douma

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.