fatal: couldn’t find remote ref refs/heads/master
brew 更新提示失败如下:
1
2
3
4
5
|
> brew update
Warning: No available formula with the name "ca-certificates".
==> Searching for similarly named formulae and casks...
Error: No formulae or casks found for ca-certificates.
fatal: Couldn't find remote ref refs/heads/master
|
解决方法:
1
2
|
/usr/local/Homebrew/Library/Taps/homebrew git:(master) > git pull origin master
|
更新后执行,依然提示失败:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
/usr/local/Homebrew/Library/Taps/homebrew git:(master) > brew update
...
==> `brew cleanup` has not been run in the last 30 days, running now...
Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).
Removing: /Users/piao/Library/Caches/Homebrew/pwgen--2.08.high_sierra.bottle.tar.gz... (13.5KB)
Removing: /Users/piao/Library/Caches/Homebrew/descriptions.json... (316.6KB)
Removing: /Users/piao/Library/Caches/Homebrew/portable-ruby-2.6.10_1.el_capitan.bottle.tar.gz... (8.7MB)
Removing: /Users/piao/Library/Caches/Homebrew/go--gobootstrap--1.16.tar.gz... (124.1MB)
Removing: /Users/piao/Library/Logs/Homebrew/pwgen... (64B)
Removing: /usr/local/lib/python3.7/site-packages/__pycache__/easy_install.cpython-37.pyc... (283B)
Removing: /usr/local/lib/python3.7/site-packages/__pycache__/sitecustomize.cpython-37.pyc... (1.4KB)
Pruned 0 symbolic links and 1 directories from /usr/local
fatal: Couldn't find remote ref refs/heads/master
|
但是提示不一样。
然后执行如下命令进行修复
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
➜ /usr/local/Homebrew/Library/Taps/homebrew git:(master) > brew tap --repair
remote: Enumerating objects: 1448, done.
remote: Counting objects: 100% (1193/1193), done.
remote: Compressing objects: 100% (346/346), done.
remote: Total 1448 (delta 979), reused 1049 (delta 841), pack-reused 255
Receiving objects: 100% (1448/1448), 246.16 KiB | 320.00 KiB/s, done.
Resolving deltas: 100% (1109/1109), completed with 8 local objects.
From https://github.com/dart-lang/homebrew-dart
* [new branch] dependabot -> origin/dependabot
* [new branch] deps -> origin/deps
* [new branch] devoncarew-patch-1 -> origin/devoncarew-patch-1
* [new branch] main -> origin/main
* [new branch] pub-dependabot -> origin/pub-dependabot
* [new branch] sortie-pull-request -> origin/sortie-pull-request
* [new branch] try-install -> origin/try-install
* [new branch] update-homebrew -> origin/update-homebrew
==> dart-lang/dart: changed default branch name from master to main!
|
清理缓存brew cleanup
:
1
2
|
➜ /usr/local/Homebrew/Library/Taps/homebrew git:(master) > brew cleanup
|
清理缓存后执行brew update-reset
,执行结果如下:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
|
➜ /usr/local/Homebrew/Library/Taps/homebrew git:(master) > brew update-reset
==> Fetching /usr/local/Homebrew...
==> Resetting /usr/local/Homebrew...
Branch 'master' set up to track remote branch 'master' from 'origin'.
Reset branch 'master'
Your branch is up to date with 'origin/master'.
==> Fetching /usr/local/Homebrew/Library/Taps/dart-lang/homebrew-dart...
==> Resetting /usr/local/Homebrew/Library/Taps/dart-lang/homebrew-dart...
Branch 'main' set up to track remote branch 'main' from 'origin'.
Reset branch 'main'
Your branch is up to date with 'origin/main'.
==> Fetching /usr/local/Homebrew/Library/Taps/ethereum/homebrew-ethereum...
==> Resetting /usr/local/Homebrew/Library/Taps/ethereum/homebrew-ethereum...
Branch 'master' set up to track remote branch 'master' from 'origin'.
Reset branch 'master'
Your branch is up to date with 'origin/master'.
==> Fetching /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask...
==> Resetting /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask...
Branch 'master' set up to track remote branch 'master' from 'origin'.
Reset branch 'master'
Your branch is up to date with 'origin/master'.
==> Fetching /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core...
remote: Enumerating objects: 700384, done.
remote: Counting objects: 100% (15401/15401), done.
Receiving objects: 12% (90042/700384), 60.34 MiB | 1.11 MiB/s
Receiving objects: 42% (300424/700384), 164.16 MiB | 1.06 MiB/s
Receiving objects: 73% (514444/700384), 253.66 MiB | 1.07 MiB/s
remote: Total 700384 (delta 15401), reused 15401 (delta 15401), pack-reused 684983
Receiving objects: 100% (700384/700384), 357.03 MiB | 1.08 MiB/s, done.
Resolving deltas: 100% (519804/519804), completed with 3813 local objects.
From https://mirrors.ustc.edu.cn/homebrew-core
356fdd474ac..8a2ea6c9279 master -> origin/master
==> Resetting /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core...
Checking out files: 100% (12948/12948), done.
Branch 'master' set up to track remote branch 'master' from 'origin'.
Reset branch 'master'
Your branch is up to date with 'origin/master'.
==> Fetching /usr/local/Homebrew/Library/Taps/homebrew/homebrew-services...
==> Resetting /usr/local/Homebrew/Library/Taps/homebrew/homebrew-services...
Branch 'master' set up to track remote branch 'master' from 'origin'.
Reset branch 'master'
Your branch is up to date with 'origin/master'.
|
到这一步就完成修复,执行brew update
不会再失败。
参考