I cloned one of my projects in windows desktop and after editing when I input git add . command then I get following error:
fatal: Not a git repository (or any of the parent directories): .git
How to solve this?
When you type git clone it will create a subdirectory in the current directory. e.g. If your current working directory is /code, the command line output could look similar to this:
$ pwd
/home/you/code [or something similar]
$ ls -F
foo bar
$ git clone http://somewhere.baz/somerepo.git
[happy git output]
$ ls -F
foo bar somerepo/
as you see you repo was cloned to the somerepo subdirectory, so the full path would be something like ~/code/repo_name. However, your current working directory remains the same, ~/code.
Next, you should step into that directory:
$ cd somerepo
$ ls
[content of your repo]
After you've changed the current working directory, you should be able to see its content (output of ls command), and be able to see git repository state with the git status command.
.gitdirectory (which usually is hidden) too?