簡體   English   中英

致命:不是git存儲庫 - 錯誤

[英]fatal: Not a git repository - Error

我是git的新手。 我只是用它來控制本地機器的版本。 我已經通過git init初始化了我的git repo。 我通過git add "folder name"手動添加了一些我需要的git add "folder name" 有一個特定的文件夾,我無法通過使用相同的命令添加。 它與其他目錄包含在同一目錄中。 但我一直fatal: Not a git repository "some path" 我不明白問題是什么。

添加輸出

root@CTO:/home/kougaikw/test# git --version
git version 1.8.3.2

root@CTO:/home/kougaikw/test# git status
# On branch master
#
# Initial commit
#
# Changes to be committed:
#   (use "git rm --cached <file>..." to unstage)
#
#       new file:   main.html
#
# Untracked files:
#   (use "git add <file>..." to include in what will be committed)
#
#       .DS_Store
#       css/
#       fonts/
#       images/
#       instance-config.json


root@CTO:/home/kougaikw/test# ls -l
total 36
drwxr-xr-x  2 root root 4096 Apr  5 17:04 css
drwxr-xr-x  2 root root 4096 Apr  5 17:04 fonts
drwxr-xr-x  5 root root 4096 Apr  5 17:04 images
-rw-r--r--  1 root root 1004 Mar 13 08:25 instance-config.json
drwxr-xr-x 10 root root 4096 Apr  5 17:05 js
-rw-r--r--  1 root root  695 Jan  7 08:50 main.html
drwxr-xr-x  8 root root 4096 Apr  5 17:06 mocks
drwxr-xr-x 13 root root 4096 Apr  5 17:07 plugins
drwxr-xr-x 14 root root 4096 Apr  5 17:07 templates

root@CTO:/home/kougaikw/test# git add js
fatal: Not a git repository: js/libs/testfolder/../../../../.git/testfolder/html/js/libs/modules

我在js / libs / testfolder目錄下有一個名為“.git”的文件夾。 刪除它,並正常工作

git中有一個錯誤允許你在你的git項目下添加任何[.git | GIT]文件夾,這個文件已在后來的git版本中修復。

在您的情況下,您在一個項目文件夾中添加了一個名為[.git]的文件夾,因此git在處理您的存儲庫時遇到了問題。

有關錯誤和修復的更多信息可以在這里找到

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM