Not a git repository (or any of the parent directories): .git

简介:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
[root@ip-172-31-22-8 molewanwan] # git remote add origin git@github.com:molewanwan/demo.git
fatal: Not a git repository (or any of the parent directories): .git
处理方法
[root@ip-172-31-22-8 molewanwan] # git init
Initialized empty Git repository  in  /home/molewanwan/ .git/
再次git remote add
[root@ip-172-31-22-8 molewanwan] # git remote add origin git@github.com:molewanwan/demo.git
[root@ip-172-31-22-8 molewanwan] # ls -la
total 20
drwx------.   3 molewanwan molewanwan   70 Nov 27 07:55 .
drwxr-xr-x. 104 root       root       4096 Nov 27 07:43 ..
-rw-r--r--.   1 molewanwan molewanwan   18 Jul  8  2015 .bash_logout
-rw-r--r--.   1 molewanwan molewanwan  193 Jul  8  2015 .bash_profile
-rw-r--r--.   1 molewanwan molewanwan  231 Jul  8  2015 .bashrc
drwxr-xr-x.   7 root       root       4096 Nov 27 07:56 .git
[root@ip-172-31-22-8 .git] # ls -la
total 20
drwxr-xr-x. 7 root       root       4096 Nov 27 07:56 .
drwx------. 3 molewanwan molewanwan   70 Nov 27 07:55 ..
drwxr-xr-x. 2 root       root          6 Nov 27 07:55 branches
-rw-r--r--. 1 root       root        197 Nov 27 07:56 config
-rw-r--r--. 1 root       root         73 Nov 27 07:55 description
-rw-r--r--. 1 root       root         23 Nov 27 07:55 HEAD
drwxr-xr-x. 2 root       root       4096 Nov 27 07:55 hooks
drwxr-xr-x. 2 root       root         20 Nov 27 07:55 info
drwxr-xr-x. 4 root       root         28 Nov 27 07:55 objects
drwxr-xr-x. 4 root       root         29 Nov 27 07:55 refs









本文转自 冰冻vs西瓜 51CTO博客,原文链接:http://blog.51cto.com/molewan/1877196,如需转载请自行联系原作者
目录
相关文章
|
编译器 开发工具 git
【Git异常】You are in ‘detached HEAD‘ state, which means that you‘re not on any branch Checkout a branch
【Git异常】You are in ‘detached HEAD‘ state, which means that you‘re not on any branch Checkout a branch
614 0
|
11月前
|
开发工具 git C++
【App Service】VS Code直接部署App Service时候遇见 “fatal: not a git repository (or any of the parent directories): .git”
通过VS Code发布Python App Service的时候,遇见了发布失败错误: The deployment failed with error: fatal: not a git repository (or any of the parent directories): .git . Please take a few minutes to help us improve the deployment experience
195 24
|
11月前
|
编译器 网络安全 开发工具
git学习五:切换本地仓库出现的问题。修改git配置初始化。error:src refspec master does not match any。错误总结,送上几个案例
这篇文章是关于Git使用中遇到的一些问题及其解决方案的总结,包括切换本地仓库时的问题、修改Git初始化配置、以及解决"error: src refspec master does not match any"错误等。
777 0
|
开发工具 git 开发者
解决fatal: not a git repository (or any of the parent directories): .git问题
解决fatal: not a git repository (or any of the parent directories): .git问题
2392 1
|
网络安全 开发工具 git
git clone之报错git@gitee.com:Permission denied (publickey).fatal: Could not read from remote repository
git clone之报错git@gitee.com:Permission denied (publickey).fatal: Could not read from remote repository
1174 0
|
监控 安全 开发工具
git fatal: detected dubious ownership in repository at ‘xxx‘ 彻底解决方法
调整文件所有权和权限后,你应该能够无误地进行Git操作。持续的维护与监控文件系统的安全性能降低将来遇到类似问题的风险,并保证团队能够高效协作。如果你是在团队环境中工作,建议建立明确的协作规则和文件管理实践,以避免此类问题。
1555 3
|
前端开发 JavaScript PHP
【Azure 应用服务】App Service 在使用GIt本地部署,上传代码的路径为/home/site/repository,而不是站点的根目录/home/site/wwwroot。 这个是因为什么?
【Azure 应用服务】App Service 在使用GIt本地部署,上传代码的路径为/home/site/repository,而不是站点的根目录/home/site/wwwroot。 这个是因为什么?
145 0
|
开发工具 git
git error 已解决【Another git process seems to be running in this repository, e.g. an editor opened by】
git error 已解决【Another git process seems to be running in this repository, e.g. an editor opened by】
266 2
|
存储 开发工具 git
【Git】Git提示Another git process seems to be running in this repository, e.g. an editor opened by ..错误
【Git】Git提示Another git process seems to be running in this repository, e.g. an editor opened by ..错误
737 0
|
网络安全 数据安全/隐私保护
解决git@github.com: Permission denied (publickey). fatal: Could not read from remote repository. Pleas
解决git@github.com: Permission denied (publickey). fatal: Could not read from remote repository. Pleas
2475 0