GIT - Add modified/new files to staging in GIT CLI

Adding a file

To add new file to the GIT staging area, run the following command with your desired filename along with the extension.

git add <filename.ext>

Adding a folder

To add all the files of a specific directory i.e., folder to GIT staging area, then use:

git add <directory>

If you want to add all the files in the current directory, then using above command:

git add .

Note: When add a directory to staging area, remember that even modified files inside subfolders will get staged.

Last Updated on

Next Post: GraphProtocol: TS2322 null assignment in Subgraph →