Forum: Ruby on Rails Adding files in git

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
3275da7fdbd73cb4e7956fd0d29164de?d=identicon&s=25 Paul Bergstrom (palb)
on 2009-04-08 09:02
Do I need to add each new file in git that is created after init?

Or does it happen when I do "git commit -a -v -m 'test'"?

If so, can I just use "git ." and it will take new files and skip old
ones?
9770ee3431156709c728f6105dd98f0d?d=identicon&s=25 Bosko Ivanisevic (Guest)
on 2009-04-08 09:36
(Received via mailing list)
You have to add files to git with:

git add .

This will add all new files. Command

git commit -a -m '....'

with add only already tracked and changed files and commit them with
given message.

On Apr 8, 9:02 am, Pål Bergström <rails-mailing-l...@andreas-s.net>
3275da7fdbd73cb4e7956fd0d29164de?d=identicon&s=25 Paul Bergstrom (palb)
on 2009-04-08 09:44
Bosko Ivanisevic wrote:
> You have to add files to git with:
>
> git add .
>
> This will add all new files. Command
>
> git commit -a -m '....'
>
> with add only already tracked and changed files and commit them with
> given message.
>
> On Apr 8, 9:02�am, P�l Bergstr�m <rails-mailing-l...@andreas-s.net>

Thanks :-)
280b78a61a968391b7e07e912be102a8?d=identicon&s=25 Robert Walker (robert4723)
on 2009-04-08 19:10
Pål Bergström wrote:
> Bosko Ivanisevic wrote:
>> You have to add files to git with:
>>
>> git add .
>>
>> This will add all new files. Command
>>
>> git commit -a -m '....'
>>
>> with add only already tracked and changed files and commit them with
>> given message.
>>
>> On Apr 8, 9:02�am, P�l Bergstr�m <rails-mailing-l...@andreas-s.net>
>
> Thanks :-)

Also note that git add --all does what git add . does, but this form
might only attempt to add modified and untracked files, rather than
attempting to add every file in the project. I don't know if it actually
matters though in practice.
3275da7fdbd73cb4e7956fd0d29164de?d=identicon&s=25 Paul Bergstrom (palb)
on 2009-04-08 19:21
Robert Walker wrote:
> Pål Bergström wrote:

>
> Also note that git add --all does what git add . does, but this form
> might only attempt to add modified and untracked files, rather than
> attempting to add every file in the project. I don't know if it actually
> matters though in practice.

I see. Good to know.
This topic is locked and can not be replied to.