Git在Samba份额上做的速度很慢。我能做些什么来加速它? [英] Git is doing very slow commits on a Samba share. What can I do to speed it up?

查看:1182
本文介绍了Git在Samba份额上做的速度很慢。我能做些什么来加速它?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在远程服务器上运行git存储库。我已经在远程服务器上设置了一个samba共享,这样我就可以将代码保存在那里,而不是在本地的Windows 7计算机上。我们正在尝试使用git,因为svn一直如此缓慢和不可靠。我们使用git的问题是,做任何提交/克隆/拉到samba共享运行超级超级慢。如果我在Windows 7机器上执行提交/克隆/拉到本地目录,它会很好,但我们需要将代码放在远程服务器上。有任何想法吗?我可以真正使用它。



编辑:



我还应该提到我已经运行git gc - 但是它并没有加速它。

解决方案

我在Git的SMB分享方面表现出了同样的问题。不幸的是,我无法在本地机器上运行开发代码,因此我使用SMB安装远程目录并使用本地计算机上的适当文本编辑器编辑源文件。



因为我在提交存储库时需要一些安慰,所以我更喜欢一个在我的本地机器上运行的GUI客户端。但是,提到的性能问题有点棘手,但需要花费很多时间。然而,我发现了一个小巧的解决方法。在向库提交任何内容之前,我使用 rsync 将一个远程源的副本拖放到本地硬盘驱动器中,如下所示:

  rsync -az --progress --exclude.gitdev@my.devserver.com:/ home / myapp / sourcecode / Devel / portal-mirror 

通过这种方式,完成远程状态的完全1对1同步需要不到一秒的时间到我的Git应用程序中的键盘快捷键),然后再做差异和提交。奇迹般有效。提交并推送到存储库后,我只需在开发服务器上执行 git reset --hard git pull 以进行同步变化回来。


I am running a git repository on a remote server. I have it set up a samba share on the remote server so I can save my code there instead of on my local windows 7 machine. We are trying to look into using git, because svn has been so slow and unreliable. The problem that we are having with git is that doing any commits/clones/pulls onto the samba share run super super slow. If i do a commit/clone/pull onto a local dir on my windows 7 machine it works great, but we need the code to be on the remote server. Any ideas? I could really use it.

Edit:

I should also mention that I have already ran git gc --aggressive and it hasn't sped it up.

解决方案

I had the same problem with Git's performance over SMB shares. Unfortunately I can't run the development code on my local machine, so I use SMB to mount the remote directory and edit the source files using a proper text editor on my local machine.

Since I want some comfort when committing to the repository, I prefer a GUI client which runs on my local machine. With the mentioned performance problems this is a bit tricky, though, and takes a lot of time.

However: I found a sleek little workaround. Before committing anything to the repository, I pull a copy of the remote sources to my local hard drive using rsync, like this:

rsync -az --progress --exclude ".git" dev@my.devserver.com:/home/myapp/sourcecode /Devel/portal-mirror

That way it takes less than a second to do a full 1-to-1 sync of the remote state (bound this to a keyboard shortcut in my Git app) before doing the diffs and commits. Works like a charm. After committing and pushing to the repository I just do git reset --hard and git pull on the dev server to sync the changes back.

这篇关于Git在Samba份额上做的速度很慢。我能做些什么来加速它?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆