git fetch がファイルを取ってきても git branch --all に出てこないので2021年02月08日 13時18分18秒

git でバグだが何だかに当たったようだ。どうも手元のデータが壊れていたらしく、修復するのに時間が掛かった。

症状として、git fetch が成功している。しかし、git branch は表示しない。そして、git checkout も失敗する。

% git remote -v
upstream        https://git.freebsd.org/src.git (fetch)
upstream        https://git.freebsd.org/src.git (push)
% git fetch upstream stable/13
remote: Enumerating objects: 394875, done.
remote: Counting objects: 100% (394869/394869), done.
remote: Compressing objects: 100% (103490/103490), done.
remote: Total 392486 (delta 293509), reused 377355 (delta 283306), pack-reused 
Receiving objects: 100% (392486/392486), 210.21 MiB | 5.07 MiB/s, done.
Resolving deltas: 100% (293509/293509), completed with 2107 local objects.
From https://git.freebsd.org/src
 * branch                stable/13  -> FETCH_HEAD
しかし、
% git checkout -b stable/13 --track upstream/stable/13
fatal: 'upstream/stable/13' is not a commit and a branch 'stable/13' cannot be created from it
% git branch --all
git branch -v --all
* main                  c3e89a30fdc [behind 1801] copyrights: Happy New Year 2021
  remotes/upstream/HEAD -> upstream/main
  remotes/upstream/main 1912d2b15e6 vt: parse_font_info_static should set refcount, not parse_font_info
最初は shallow チェックアウトのせいかと思ったが、それが原因ではなかったようだ。
% git fetch --unshallow upstream stable/13
remote: Enumerating objects: 2368199, done.
remote: Counting objects: 100% (2368109/2368109), done.
remote: Compressing objects: 100% (696673/696673), done.
remote: Total 2328753 (delta 1852940), reused 2040221 (delta 1596441), pack-reused 0
Receiving objects: 100% (2328753/2328753), 677.06 MiB | 4.88 MiB/s, done.
Resolving deltas: 100% (1852940/1852940), completed with 33224 local objects.
From https://git.freebsd.org/src
 * branch                    stable/13  -> FETCH_HEAD
%
%
% git checkout -b stable/13 --track upstream/stable/13
fatal: 'upstream/stable/13' is not a commit and a branch 'stable/13' cannot be created from it
% git branch --all
git branch -v --all
* main                  c3e89a30fdc [behind 1801] copyrights: Happy New Year 2021
  remotes/upstream/HEAD -> upstream/main
  remotes/upstream/main 1912d2b15e6 vt: parse_font_info_static should set refcount, not parse_font_info

どうも git 内部のデータが壊れていたようだ。git remote rm で一度削除し、add で同じリモートを入れ直すと直った。

% git remote rm upstream
% git remote add upstream https://git.freebsd.org/src.git

コメント

コメントをどうぞ

※メールアドレスとURLの入力は必須ではありません。 入力されたメールアドレスは記事に反映されず、ブログの管理者のみが参照できます。

※なお、送られたコメントはブログの管理者が確認するまで公開されません。

名前:
メールアドレス:
URL:
コメント:

トラックバック

このエントリのトラックバックURL: http://uyota.asablo.jp/blog/2021/02/08/9345224/tb

※なお、送られたトラックバックはブログの管理者が確認するまで公開されません。