fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
Traceback (most recent call last):
File "<frozen runpy>", line 198, in _run_module_as_main
File "<frozen runpy>", line 88, in _run_code
File "C:\Users\leexi\AppData\Local\Programs\Python\Python312\Scripts\mkdocs.exe\__main__.py", line 7, in <module>
File "C:\Users\leexi\AppData\Local\Programs\Python\Python312\Lib\site-packages\click\core.py", line 1157, in __call__
return self.main(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\leexi\AppData\Local\Programs\Python\Python312\Lib\site-packages\click\core.py", line 1078, in main
rv = self.invoke(ctx)
^^^^^^^^^^^^^^^^
File "C:\Users\leexi\AppData\Local\Programs\Python\Python312\Lib\site-packages\click\core.py", line 1688, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\leexi\AppData\Local\Programs\Python\Python312\Lib\site-packages\click\core.py", line 1434, in invoke
return ctx.invoke(self.callback, **ctx.params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\leexi\AppData\Local\Programs\Python\Python312\Lib\site-packages\click\core.py", line 783, in invoke
return __callback(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\leexi\AppData\Local\Programs\Python\Python312\Lib\site-packages\mkdocs\__main__.py", line 314, in gh_deploy_command
gh_deploy.gh_deploy(
File "C:\Users\leexi\AppData\Local\Programs\Python\Python312\Lib\site-packages\mkdocs\commands\gh_deploy.py", line 129, in gh_deploy
ghp_import.ghp_import(
File "C:\Users\leexi\AppData\Local\Programs\Python\Python312\Lib\site-packages\ghp_import.py", line 285, in ghp_import
git.check_call('push', opts['remote'], opts['branch'])
File "C:\Users\leexi\AppData\Local\Programs\Python\Python312\Lib\site-packages\ghp_import.py", line 119, in check_call
sp.check_call(['git'] + list(args), **kwargs)
File "C:\Users\leexi\AppData\Local\Programs\Python\Python312\Lib\subprocess.py", line 413, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['git', 'push', 'origin', 'gh-pages']' returned non-zero exit status 128.
解决方法:
在使用 mkdocs gh-deploy 进行部署时,遇到了 Repository not found 和 Could not read from remote repository 错误。这通常是由于以下几个原因之一引起的:
PS D:\college application> git clone https://github.com/Slowist-Lee/college_application.git Cloning into 'college_application'... remote: Enumerating objects: 162, done. remote: Counting objects: 100% (162/162), done. remote: Compressing objects: 100% (122/122), done. remote: Total 162 (delta 29), reused 147 (delta 17), pack-reused 0 Receiving objects: 100% (162/162), 1.47 MiB | 953.00 KiB/s, done. Resolving deltas: 100% (29/29), done. PS D:\college application> git fetch origin fatal: not a git repository (or any of the parent directories): .git
看起来你在尝试克隆一个GitHub仓库到本地,并且已经成功克隆了名为college_application的仓库。但是,当你尝试执行git fetch origin命令时,遇到了错误,提示fatal: not a git repository (or any of the parent directories): .git。这通常意味着当前目录不是一个Git仓库,或者.git目录没有正确设置。