A developer wants to commit only certain files. But unable to commit as it requires clean(staged and committed all changes) working directory.


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.

  • I want to push only some of the modified files to remote. And other files should remain unstage. – bh22 Jun 14 at 12:56
  • 1
    @bh22 that’s exactly what jjj is explaining. git add the files you want to push, git commit, then git push. The other files will remain unstaged. – Stephen Kitt Jun 14 at 16:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.