by Sai gowtham

How to commit Specific files in Git

In this tutorial, we are going to learn about how to commit specific files in git instead of committing all files.

Committing specific files

  1. Change your current working directory to the git repository.
  2. Now, add the files you need to commit by running the git add command followed by your file names.
git add my-file1.js my-file2.js
  1. Run the git commit command to commit your specified files in step 2.
git commit -m 'added my-file1.js & my-file2.js'

Top Udemy Courses

JavaScript - The Complete Guide 2020 (Beginner + Advanced)
JavaScript - The Complete Guide 2020 (Beginner + Advanced)
45,614 students enrolled
52 hours of video content
View Course
React - The Complete Guide (incl Hooks, React Router, Redux)
React - The Complete Guide (incl Hooks, React Router, Redux)
284,472 students enrolled
40 hours of video content
View Course
Vue JS 2 - The Complete Guide (incl. Vue Router & Vuex)
Vue JS 2 - The Complete Guide (incl. Vue Router & Vuex)
130,921 students enrolled
21 hours of video content
View Course