In this tutorial, we are going to learn about how to commit specific files in git instead of committing all files.
Change your current working directory to the git repository.
Now, add the files you need to commit by running the
git addcommand followed by your file names.
git add my-file1.js my-file2.js
- Run the
git commitcommand to commit your specified files in step 2.
git commit -m 'added my-file1.js & my-file2.js'