Problem tracking one file in Git


I decided to start trying to use Git today and it seems that two of my files are being tracked, but the index.html one is not. Is there a simple fix to this does anyone know?

I have googled a bit and it’s getting very complicated, so I thought I’d ask if there was a simple way? (I did see on a video that I should be able to hover over the file and click ‘+’ to start tracking it, but the ‘+’ does not appear when I do this.

I have also tried looking up how to delete everything and start again, but since I am completely new to this, the process looks complicated/time-consuming and I just want to see if this can be sorted more quickly if anyone would know please?

have you used the git add command to start tracking the index.html file?

git add index.html

no. Where am I supposed to add the command please?

you should write it in the terminal you are using for git

what way are you using to use git?

You can delete the .git folder to start over. It is hidden so you have to be able to see hidden files/folders or use the terminal to delete it. I would be careful with the terminal to delete files and folders if you are not comfortable with it yet.

In VS Code you have to be on the Source Control tab to see the Git interface.

1 Like

I have read your post but I am not quite sure what’s the problem you are trying to resolve. What’s the behavior you expected that it is not happening according to you?
Note: Deleting the git repository and starting anew is not going to “fix” the problem, in my view. It will only give you the change to be in the same situation.

If index.html file is not being tracked. you can add manually it by running command:
git add index.html

1 Like