skip to Main Content

Here is a picture showing my directory I’m quite sure that I’ve made the files (index.html and readme.md) in the folder I initialize git. The files turn green and there was a U next to age after I typed "git init".

I then typed git add .
I then typed git commit -m "first commit
I then typed git log and saw the commit was committed successfully.
Then I edit those files again, and type git status and I receive in Visual Studio Code, ‘On branch master nothing to commit, working tree clean’.

Instead, shouldn’t I after editing the fails get something like ‘Changes not staged for commit’ or the U symbol next to the files again?

I have retried doing the above with different folders and different files and I still get ‘Working clean tree’.

2

Answers


  1. Sounds like you are using the right commands, but something else must be wrong.

    You might want to check the scope of your command line. If you’re using Git Bash, make sure you’re still on the folder for your repository and not a subfolder or the place where you created it.

    If it is saying "working tree clean," then your files are either untracked and being ignored, or they are not within the scope of your repository.

    Login or Signup to reply.
  2. As found in the comments, and indicated by the white dot in the tab handle of the editor panel for your file, you forgot to save the file(s) after making changes to them before you ran git status. The changes you made were just in the program’s memory and had not yet been written to the files in your filesystem.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search