Adding files in git

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?

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 [email protected]

Bosko I. 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 [email protected]

Thanks :slight_smile:

Pål Bergström wrote:

Bosko I. 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 [email protected]

Thanks :slight_smile:

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.

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