'git push and commit is not working in Vscode

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.



Solution 1:[1]

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.

Solution 2:[2]

Try Connecting your Git to your Github( or any Version Control website ),

  1. Create your Github repository were to want to push... Then in your local repository after committing.
  2. Add the Github Url where you want to push your local repository.
    git remote add origin remote <repository URL>
  3. Then push your local repository to your github:
    git push origin master

It may also happen that there are multiple remote-URLs: Instead of removing and re-adding, you can do this:
git remote set-url origin git://new.url.here and again run the commands 2,3

Solution 3:[3]

Just ran into this problem setting up a new computer. For me, it turns out that I forgot to SAVE the files before committing them. On VSCode a lot of people click auto save which saves you the hassle, but if you don't have autosave on, remember to save the files you've changed then commit them!

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 dan1st
Solution 2 Amit Sharma
Solution 3 Thomas Park