Git 分支嵌套自身

Git branch nesting itself

当我将此分支推送到远程时,我有一个本地 git 分支。我看到我的本地分支嵌套在远程分支上:

本地分支结构:

source_code
|
|- images
|- fonts
|- index.html 

远程分支结构:

source_code
|
|- images
|- fonts
|- index.html 
|- source_code
   |- images
   |- fonts
   |- index.html 

当我尝试拉取它时,我在我的本地分支上没有看到这个文件夹。

我不确定是什么导致了这个问题。任何人都可以帮我解决这个问题,在此先感谢。

你的目录结构

source_code
|
|- images
|- fonts
|- index.html 
|- source_code (*)
   |- images
   |- fonts
   |- index.html 

因为有人在复制时出错(或 Ctrl + drag-n-drop)或其他人出错了。解决办法:删除文件夹source_code(*),然后

git add .
git commit -m"Remove unnecessary folder"
git push -v

一切都会好的。