简体   繁体   English

Eclipse远程跟踪分支突然全不见了

[英]Eclipse remote tracking branches are all missing suddenly

I used to have many branches in remote tracking.我曾经在远程跟踪中有很多分支。

After I set the GIT_TRACE_PACKET to be 1, change the GIT remote connection timeout to be 6000, import a new repository project down tried for so many times due to premature EOF error, at the end I successfully import the repository.在我将GIT_TRACE_PACKET设置为1后,将GIT远程连接超时时间改为6000,由于过早的EOF错误尝试了很多次导入新的存储库项目,最终我成功导入了存储库。

However, the remote tracking branches are all missing for all the projects including the existing project's remote tracking at the end.但是,所有项目都缺少远程跟踪分支,包括最后对现有项目的远程跟踪。

I tried to set the GIT_TRACE_PACKET to be 0 or retry importing the project but it's still the same.我尝试将 GIT_TRACE_PACKET 设置为 0 或重试导入项目,但它仍然相同。
I doubt that maybe some kind of configuration changed and made the remote tracking branches to be missing.我怀疑可能是某种配置发生了变化,导致远程跟踪分支丢失。

日食远程跟踪

Switch to command line and check you git config --get remote.origin.fetch refspec .切换到命令行,并检查你git config --get remote.origin.fetch 的Refspec

To fetch all branches, the refspec needs to be:要获取所有分支,refspec 需要是:

+refs/heads/*:refs/remotes/origin/*

If the refspec is:如果 refspec 是:

+refs/heads/master:refs/remotes/origin/master

Then a fetch would only bring back the master branch.然后fetch只会带回master分支。
This is typical of a git clone --branch develop --single-branch .这是典型的git clone --branch develop --single-branch

So change your fetch refspec, do a git fetch , and double-check the remote tracking branches with git branch -avv .因此,更改您的 fetch refspec,执行git fetch并使用git branch -avv仔细检查远程跟踪分支。

Finally, switch back to Eclipse and check the remote tracking section.最后,切换回 Eclipse 并检查远程跟踪部分。

I found another alternative way to solve this problem.我找到了另一种解决此问题的替代方法。 1. Delete the file C:\\Users*****\\workspace.metadata folder. 1. 删除文件 C:\\Users*****\\workspace.metadata 文件夹。 2. Open the eclipse again. 2. 再次打开eclipse。 3. Your eclipse configuration are all reset as origin. 3. 你的eclipse配置都被重置为origin。

Deleting .metadata will remove all the projects from Eclipse and will reset everything.删除 .metadata 将从 Eclipse 中删除所有项目并将重置所有项目。 So, best solution is to perform a pull (Right Click -> Team -> Pull) and then try rebasing.因此,最好的解决方案是执行拉取(右键单击 -> 团队 -> 拉取),然后尝试变基。 If this doesn't work, delete the eclipse project and local repository and the checkout the branch again.如果这不起作用,请删除 eclipse 项目和本地存储库,然后再次检出分支。 Then do a Pull and try rebasing.然后做一个拉动并尝试变基。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM