How can you add files to Git?

Once you created new files in Git project folder, you can add them in Git using git add command. Only files that are added, can be pushed to make it part of Git repository.

Add selected files in the current branch:

git add file1.html, file2.txt

Add All files in the current branch:
When you have a lot of files and directories and want to add all, you can use the following commands:

1) Use git add command with dot (.)
git add *

2) Use git add command with –all flag
git add -all


Learn more about the similar topics:
Tutorials
No Content Found.
Exercises & Assignments
No Content Found.
Interview Questions & Answers
No Content Found.