user5570680 user5570680 - 13 days ago 5
Git Question

git commit shows untracked files

I want to commit my files and type this command


git commit -a -m "all base files"


it shows some untracked files that contains files I want to track..
I need to commit html files, checked gitignore files but cant find why its untracked.. why they are untracked? how git decided himself to not track these files? how can I commit files I choose in this list ?
here is ss:
enter image description here

Answer

There is nothing wrong here. The untracked files simple means git found some file in your local(your PC) which is not present in the remote (git repo), that means you have created new files. To commit this you can do these commands:

$git status //optional, this will show all the files which are changed and which have added to next commit and which are not.

$git add . //this will add all the file which are changed to next commit.

or

$git add "filepath" //this will add only specific file to next commit.

then

$git commit -m "all base files"