GitHub for Windowsでsyncが失敗する

2015年3月13日頃、なぜかGitHub for Windowsのsyncが必ず失敗するようになった。3月17日には自然と回復したが、当時の状況と解決策を以下に記述する。

 


状況

あるレポジトリGitHub for windowsからファイルをCommitしてsyncを行っていた。Aboutからバージョンを確認すると、「There Will Be Conflicts (2.10.1.1)d8f9sd6 GitHub for Windows is up to date」と記述されていた

f:id:kiliwave:20150317172740p:plain

しかしある時点からプログレスバーの1/3くらいで必ず失敗し、「Failed to sync this branch. You might need to open a shell and debug the state of this repo.」と表示されるようになった。

f:id:kiliwave:20150317173018p:plain

問題のありそうなファイル(エクセルファイル・・・)のcommitを、GUIの右上の設定にある「Undo most recent commit」してから実行しても同様だった。2015年3月9日までは上手くいっていた。

f:id:kiliwave:20150317173420p:plain

ファイルをcommitしていない状態でsyncを押しても、同様に失敗する画面になる。レポジトリの容量は800MBくらい。確か上限が1GBだからまだいけるはず。

 


状況確認

参考:

hack.aipo.com

hack.aipo.com


GUIの右上の設定にある「Open in Git Shell」を選択、Windows powershell(普通はGitshell? コマンドライン?)が起動する。

syncを行いたいファイルのディレクトリに移動し、

> git status

を実行する。

On branch master
Your branch is up-to-date with 'origin/master'.

nothing to commit, working directory clean

と表示され、問題なさそうだった。

> git log

を実行すると、

0 [main] us 0 init_cheap: VirtualAlloc pointer is null, Win32 error 487
AllocationBase 0x0, BaseAddress 0x68570000, RegionSize 0x90000, State 0x10000
C:\Users\★★★\AppData\Local\GitHub\PortableGit_c2ba306e536fdf878271f7fe636a147ff37326ad\bin\less.exe: *** Couldn't reserve space for cygwin's heap, Win32 error 0

これはCUI起動関連のエラー?今回の事象とは関係なさそう。

 


解決策

GitHub for Windows で更新したいファイルのコミットまで実行し、

> git push

を実行すると、

Counting objects: 11, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (6/6), done.
Writing objects: 100% (6/6), 48.38 KiB | 0 bytes/s, done.
Total 6 (delta 4), reused 0 (delta 0)
To https://github.com/★/.git
7fcdc06..9c449c8 master -> master

と表示され、syncが完了する。

GUI上ではこの後もしばらくsync失敗が続いていたが、数日後に前触れもなく復旧した。その時にGitHub for Windowsのバージョンは変わっていなかった。

以上。