How to git add a whole folder

Viewed 119492

I'm new to git and I am trying to git add my whole working directory but I receive the error message:

fatal: pathspec 'folder' did not match any files.

I'm in the working dir when I do this command, what am I doing wrong? Also, is it good practice to commit the whole folder instead of file by file? Thank you

5 Answers

If the folder contains space you need to enclose the name with quotation marks:

git add "New Folder/"

you must type the folder's name between quotation marks.

here is the pseudo-code:

git add 'folder name'
Related