简体   繁体   English

"为什么带有 SouceTree 的 WSL2 上的 Git 对我来说这么慢?"

[英]Why is Git on WSL2 with SouceTree so slow for me?

My environment is as follows.我的环境如下。

  • Windows10(version 2004, build 19041.572) Windows10(2004版,build 19041.572)<\/li>
  • 64 bit OS 64位操作系统<\/li>
  • On WSL2, I use Ubuntu(Ubuntu-20.04)在 WSL2 上,我使用的是 Ubuntu(Ubuntu-20.04)<\/li>
  • I use git with SourceTree.我将 git 与 SourceTree 一起使用。<\/li><\/ul>

    I use docker-compose to develop Web services.我使用 docker-compose 来开发 Web 服务。 Running docker-compose on Windows is very slow for accessing web pages.在 Windows 上运行 docker-compose 访问网页非常慢。 I created a docker environment in the Ubuntu's Home folder on WSL2.我在 WSL2 上的 Ubuntu 的 Home 文件夹中创建了一个 docker 环境。 Web site data (Laravel) is installed in the docker environment on WSL2 and managed by git.网站数据(Laravel)安装在 WSL2 上的 docker 环境中,由 git 管理。

    How can i improve the speed of SourceTree on WSL2?如何提高 WSL2 上 SourceTree 的速度? Git on Windows is faster. Windows 上的 Git 更快。

    "

Unfortunately WSL2 has an issue with filesystem performance on /mnt .不幸的是,WSL2 在/mnt上存在文件系统性能问题

Might be an option to checkout your repo into container's /home , instead of /mnt/... , if you don't need to edit it from windows.如果您不需要从 Windows 编辑它,可能是将您的 repo checkout到容器的/home而不是/mnt/...的选项。

Running Docker from a Linux container on windows will not help.在 Windows 上从 Linux 容器运行 Docker 无济于事。

UPD: The same issue can appear on a large project w/o mounting anything, but still accessing repo inside WSL by \\\\wsl$ path from Windows. UPD:同样的问题可能会出现在一个没有安装任何东西的大型项目中,但仍然可以通过 Windows 的\\\\wsl$路径访问 WSL 内的 repo。 The issue still open.问题仍然悬而未决。

My solution is to use git tasks/command inside the IDE that supports WSL.我的解决方案是在支持 WSL 的 IDE 中使用 git 任务/命令。

I use Visual Studio Code inside WSL 2 and use git extensions to do git tasks/commands.我在 WSL 2 中使用 Visual Studio Code 并使用 git 扩展来执行 git 任务/命令。 The performance is superb!表演太棒了! :-D :-D

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

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