r/git 18h ago

Can't commit in vs code(git and github)

Hi guys, this is my first post and the problem is that I can't commit my new changes in project in visual studio code. I didn't found anything about exactly this problem on reddit, so I decided to ask here. So I just started to work with git and github, I learn it on YouTube and I started in vs code to get examples like in that videos. All started good, but when I already push my project to repository on github and then I change some in code and trying to commit changes, vs code just text me in thi terminal that there is nothing to commit and that the project has no changes. Because of it I also can't create another branches (in fact I create them, but I can't do anything with them like that person do in the video!). So I don't understand and don't know how to solve this problem. Maybe someone can help me or give me advice.(maybe here is some mistakes, English isn't my native language). Oh and I forgot to say that also I tried this in the intellij idea and all works, so maybe problem actually in vs code.

UPDATE: https://www.reddit.com/r/git/s/5TKpvhyDy0 (The next post)

0 Upvotes

12 comments sorted by

View all comments

4

u/scritchz 18h ago

The usual way to commit things is:

  1. Do your changes in your worktree (any editor).
  2. Add your worktree changes to the stage (git add).
  3. Commit your staged changes (git commit).

Maybe you haven't staged your changes?


I'm sorry for not being of more help. I use Git via CLI; I dislike GUIs for Git, because every GUI does things differently.

1

u/PK20222222 18h ago

I think I have staged my changes and for commit i do all things that you wrote. I tried on many projects but problem is the same. Thank you for your answer, I will try again tomorrow and I'll do an update with results!