git push and commit is not working in Vscode

17,573

I think that you don't stage the files before committing.

You can decide what files you want to commit and what files you don't want to commit.

By default, files are installed and won't be committed.

In visual studio code, you can stage changes in the git view using the + button:

Image of staging in VSC

After that, you should be able to commit and push the stages files.

Share:
17,573
Satyam Shah
Author by

Satyam Shah

Computer Science Engineering Student

Updated on June 08, 2022

Comments

  • Satyam Shah
    Satyam Shah almost 2 years

    I signed up in vs code with git , did all setup , my repository is loading and showing all the modifications done but the commit and push is not working , as i press commit no error shows up. It syncs properly with git . I even tried to remove all and re do all.

  • dan1st
    dan1st almost 4 years
    I think the OP meant the VSC integration, not the CLI...
  • Juhana Pietari Lehtiniemi
    Juhana Pietari Lehtiniemi over 3 years
    In the Visual Studio Code settings there seems to be a settings for "Enable smart commit" ("Commit all changes when there are no staged changes"). This way you can automatically commit all without staging the files separately. Saved me some clicks.