git 2.18 win64,签出分支时出现奇怪错误,仅在我的电脑中

git 2.18 win64,签出分支时出现奇怪错误,仅在我的电脑中,git,Git,这是一个奇怪的错误,我将粘贴这些步骤,以便您更好地理解: PS C:\Users\user\Proyectos\GRV\Repos> git clone https://user@bitbucket.xxx.com/scm/in004/site-code.git in004_code Cloning into 'in004_code'... remote: Counting objects: 4034, done. remote: Compressing objects: 100% (3

这是一个奇怪的错误,我将粘贴这些步骤,以便您更好地理解:

PS C:\Users\user\Proyectos\GRV\Repos> git clone https://user@bitbucket.xxx.com/scm/in004/site-code.git in004_code

Cloning into 'in004_code'...
remote: Counting objects: 4034, done.
remote: Compressing objects: 100% (3565/3565), done.
remote: Total 4034 (delta 366), reused 4010 (delta 358)
Receiving objects: 100% (4034/4034), 10.11 MiB | 280.00 KiB/s, done.
Resolving deltas: 100% (366/366), done.
Checking out files: 100% (3577/3577), done.
PS C:\Users\user\Proyectos\GRV\Repos> cd .\in004_code\
PS C:\Users\user\Proyectos\GRV\Repos\in004_code> git status
On branch master
Your branch is up to date with 'origin/master'.

nothing to commit, working tree clean
PS C:\Users\user\Proyectos\GRV\Repos\in004_code> cat .\.gitmodules
[submodule "sites/default/files"]
        path = sites/default/files
        url = ../site-files.git
[submodule "profiles/hub"]
        path = profiles/hub
        url = ../../hub/hub-profile.git
        branch = 0.x
PS C:\Users\user\Proyectos\GRV\Repos\in004_code> git checkout int
fatal: bad config line 7 in file C:/Users/user/Proyectos/GRV/Repos/in004_code/.gitmodules
PS C:\Users\user\Proyectos\GRV\Repos\in004_code> cat .\.gitmodules
[submodule "sites/default/files"]
        path = sites/default/files
        url = ../site-files.git
[submodule "profiles/hub"]
        path = profiles/hub
        url = ../../hub/hub-profile.git
<<<<<<< HEAD
        branch = 0.x
=======
>>>>>>> 5580772... Initial commit qa
PS C:\Users\user\Proyectos\GRV\Repos\in004_code>
PS C:\Users\user\Proyectos\GRV\Repos>git克隆https://user@bitbucket.xxx.com/scm/in004/site-code.git in004\u代码
正在克隆到“in004_代码”。。。
远程:计数对象:4034,完成。
远程:压缩对象:100%(3565/3565),完成。
远程:总计4034(增量366),重复使用4010(增量358)
接收对象:100%(4034/4034),10.11 MiB | 280.00 KiB/s,完成。
解析增量:100%(366/366),完成。
签出文件:100%(3577/3577),完成。
PS C:\Users\user\Proyectos\GRV\Repos>cd。\in004\u代码\
PS C:\Users\user\Proyectos\GRV\Repos\in004\u code>git状态
论分行行长
您的分支机构是最新的“来源/主”。
没什么要承诺的,正在清理树
PS C:\Users\user\Proyectos\GRV\Repos\in004\u code>cat.\.gitmodules
[子模块“站点/默认值/文件”]
路径=站点/默认值/文件
url=../site-files.git
[子模块“配置文件/集线器”]
路径=外形/轮毂
url=../hub/hub-profile.git
分支=0.x
PS C:\Users\user\Proyectos\GRV\Repos\in004\u code>git checkout int
致命:文件C:/Users/user/Proyectos/GRV/Repos/in004_code/.gitmodules中的第7行配置错误
PS C:\Users\user\Proyectos\GRV\Repos\in004\u code>cat.\.gitmodules
[子模块“站点/默认值/文件”]
路径=站点/默认值/文件
url=../site-files.git
[子模块“配置文件/集线器”]
路径=外形/轮毂
url=../hub/hub-profile.git
> 5580772... 初始提交qa
PS C:\Users\user\Proyectos\GRV\Repos\in004\u代码>
但这不会发生在同事身上,也不会发生在centos服务器上,我在那里测试了相同的步骤


有什么帮助吗?

小编辑/更新:看起来默认情况下查看此错误的特定控件设置是
recurse.submodules
,它是在Git 2.14中引入的。早于2.14的Git版本将忽略任何
递归。submodules=true
设置,而2.14及更高版本将遵守该设置。另外,git checkout(无递归子模块)可能有一个bug,没有在正确的时间清除标志。但是,
git-c recurse.submodules=false checkout…
应该可以解决这个问题。我认为失败本身就是退出,
fatal:…
终止签出也是一个错误,但这还不太清楚


许多CentOS发行版附带的Git版本都很古老,无法检查错误情况。(您没有说明他们使用的是哪种CentOS,也没有显示他们的Git版本,但请参阅,例如,或最近的版本。保守更新软件没有什么错,但是保守,然后是CentOS…)

您的实际存储库中有一个错误:
.gitmodules
文件应该总是格式正确的,但是
int
分支顶端的文件格式不正确。您的Git是现代的,当您运行
Git checkout int
时,它会立即发现问题


他们的Git很古老,所以当您查看那里的
int
分支时,他们的Git会悄悄地忽略这个问题。问题仍然存在,你只是没有收到投诉。需要修复该问题(通过修复
.gitmodules
文件并在
int
分支上进行新的提交)。

小编辑/更新:在默认情况下,查看此错误的特定控件设置似乎是
recurse.submodules
,它是在Git 2.14中引入的。早于2.14的Git版本将忽略任何
递归。submodules=true
设置,而2.14及更高版本将遵守该设置。另外,git checkout(无递归子模块)可能有一个bug,没有在正确的时间清除标志。但是,
git-c recurse.submodules=false checkout…
应该可以解决这个问题。我认为失败本身就是退出,
fatal:…
终止签出也是一个错误,但这还不太清楚


许多CentOS发行版附带的Git版本都很古老,无法检查错误情况。(您没有说明他们使用的是哪种CentOS,也没有显示他们的Git版本,但请参阅,例如,或最近的版本。保守更新软件没有什么错,但是保守,然后是CentOS…)

您的实际存储库中有一个错误:
.gitmodules
文件应该总是格式正确的,但是
int
分支顶端的文件格式不正确。您的Git是现代的,当您运行
Git checkout int
时,它会立即发现问题


他们的Git很古老,所以当您查看那里的
int
分支时,他们的Git会悄悄地忽略这个问题。问题仍然存在,你只是没有收到投诉。需要修复该问题(通过修复
.gitmodules
文件,并在
int
分支上进行新的提交)。

具体来说,似乎有人没有正确修复冲突,可能是在合并或重定基础操作期间。
@madpysicator,但我不明白为什么在我尝试切换到int分支时会出现此错误,并且只有在我切换到int分支后文件才会更改。因为在master和int中,文件格式良好(见Bitbucket web)。@madPhysician我没关系看到它实际上在int中被破坏了
。gitmodules
文件是一个文件。因此,它存在于每个提交中(好的,每个将文件切换到不包含文件的提交的提交,如果存在这样的情况,将从工作树中删除该文件)。主控
当前提示处提交中的副本格式正确。提交中
int
当前提示处的副本格式不正确。就像每个提交的文件一样,每个提交都有一个副本,但并非所有副本都是相同的!现在,如果我不能切换到int来制作一个
git checkout master.gitmodules
来带来一个好的,那么如何在int中修复它呢