A developer wants to commit only certain files. But unable to commit as it requires clean(staged and committed all changes) working directory.
Asked
Active
Viewed 6,273 times
2 Answers
2
When in doubt, just use the command prompt. “git add ” for the things to stage and “git commit -m ” after you’ve added them all.
If you have changes locally, you can “git stash”, make your changes and then “git stash pop” after you committed them.

jjj
- 111
0
To commit certain files, you need to do the following things as shown below:
git status
git add . // for all files
git add "fileName" // for a specific file
git commit -m "the Message" //change message for commit
Then, just use git push
command.
git add
the files you want to push,git commit
, thengit push
. The other files will remain unstaged. – Stephen Kitt Jun 14 '19 at 16:09