【问题标题】:Git branch nesting itselfGit分支嵌套本身
【发布时间】:2021-01-18 14:52:11
【问题描述】:

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

本地分支结构:

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

远程分支结构:

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

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

我不确定,是什么导致了这个问题。谁能帮我解决这个问题,在此先感谢。

【问题讨论】:

  • 你能粘贴git输出的错误信息吗?这对帮助非常有用。

标签: git version-control gitlab


【解决方案1】:

你的目录结构

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

因为复制(或 Ctrl + 拖放)时有人弄错了,或者其他人弄错了。解决方法:删除文件夹source_code(*),然后

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

一切都会好的。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2014-09-08
    • 2012-03-05
    • 2020-11-26
    • 1970-01-01
    • 2015-10-19
    • 1970-01-01
    • 2016-04-12
    • 1970-01-01
    相关资源
    最近更新 更多