It’s Been a Long Time Since I Had To Patch a Binary Executable…

Needed to push a file created on a notebook the other night to a Git repo on a desktop, both running Windows and connected to my home router. Thought the git protocol would work. It did not due to a bug in msysgit
. (TL/DR: the bug has been open since March 2010, but nobody so far has volunteered to find the root cause and remedy, or sponsor such an effort. The only sensible workaround is to recompile msysgit from source with the side-band-64k
protocol capability disabled, as the older side-band
does not exhibit the problem, but the newer, faster alternative always takes precedence if both
client and server support it.)

Followed the advice from Eli Billauer’s blog
and patched git.exe
on my desktop, which plays the role of a “central” Git server.

Here is a patch script that worked for me. It requires Gsar for Windows
from the GnuWin32 collection; CygWin likely includes gsar

@echo off
copy /-y git.exe git.exe~
if errorlevel 1 goto copyfailed
gsar -o -sside-band-64k -rKW6YzEZbBv584 git.exe
if errorlevel 1 goto patchfailed
echo git.exe successfully patched
goto quit
echo Could not create a backup copy of git.exe
goto quit
echo Could not patch git.exe with GSAR
goto quit

The value of the -r
option is just a random 13-character string generated by DuckDuckGo using the query password 13
. You may wish to use different values on each Windows machine you may be pushing to using the git protocol.


This entry was posted on Tuesday, December 11th, 2012 at 10:44 pm and is filed underNotes for myself,Small Hacks. You can follow any responses to this entry through theRSS 2.0feed. You can skip to the end and leave a response. Pinging is currently not allowed.

稿源:Dmitry Leskov (源链) | 关于 | 阅读提示

本站遵循[CC BY-NC-SA 4.0]。如您有版权、意见投诉等问题,请通过eMail联系我们处理。
酷辣虫 » 科技动态 » It’s Been a Long Time Since I Had To Patch a Binary Executable…

喜欢 (0)or分享给?

专业 x 专注 x 聚合 x 分享 CC BY-NC-SA 4.0

使用声明 | 英豪名录