The first time I used git, I encountered this error prompt. It turned out to be like this:
fatal: Not a git repository (or any of the parent directories): .git
This tells you that the directory you’re in is not a git repository. Before you can add remote servers, commit things and so you must have a git repository created.
In a git repository there’s a directory (which can be hidden) named.git. It contains metadata on the repository and all the data regarding the checked files.
To create it typegit initin the directory you wish to have a git repository. Then you could add remote servers and perform operations on it.
1.fatal: Not a git repository (or any of the parent directories): .git
After this problem, we found that there is no such directory as. Git in this system, so we used git — help command in the terminal to display some of its main command parameters. We found that one parameter is init: help
2.init Create an empty git repository or reinitialize an existing one
After git init is executed and then recompiled, this problem is solved. One thing to note here is that unlike SVN, SVN does not need to use its own commands to create its own repository, while git needs to use its own commands to create it manually. The specific location of GIT depends on which directory you execute the command in
Similar Posts:
- [Solved] Git remote:error:refusing to update checked out branch:refs/heads/master”
- [Solved] ImportError:attempted relative import with no known parent package
- Git Error: RPC failed, curl 18 transfer closed with outstanding read data remaining
- GitHub# fatal: ‘origin’ does not appear to be a git repository
- When IntelliJ idea starts, can’t start git will pop up to solve the problem
- [Solved] Git push origin master fatal: ‘origin’ does not appear to be a git repository fatal…
- Go1.6+ install Error: go: go.mod file not found [How to Solve]
- How to Solve git loose object Error (Three Methods)
- error: src refspec master does not match any [How to Solve]
- How to Solve error: failed to push some refs to ‘xxxx’