gpt4 book ai didi

git rev-parse HEAD 返回非零退出状态 128

转载 作者:行者123 更新时间:2023-12-02 02:15:29 25 4
gpt4 key购买 nike

面对 git commit 的这个问题:

fatal: Not a git repository: '.git'
....
File "C:\Repo\xyz\extern\VerFw\Src\ComponentLineImporter\__init__.py", line 28, in <module>
from .Version import __version__
File "C:\Repo\xyz\extern\VerFw\Src\ComponentLineImporter\Version.py", line 22, in <module>
__version__ = subprocess.check_output('git rev-parse HEAD', cwd=os.path.dirname(os.path.abspath(__file__))).decode().strip()
File "c:\program files\python36\lib\subprocess.py", line 336, in check_output
**kwargs).stdout
File "c:\program files\python36\lib\subprocess.py", line 418, in run
output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command 'git rev-parse HEAD' returned non-zero exit status 128.

当我唯一的存储库中没有 ComponentLineImporter 的此类重复文件夹时,为什么会出现此错误?

最佳答案

您需要 CD(更改目录)到您的 git 存储库。您要么不在正确的路径中,要么尚未使用 create 创建 git 存储库。

让你的终端位于现有的 git 存储库下。例如,使用 bash 您也应该看到您的分支的名称。

例如:

MINGW64 ~/../Source_code/pylint_Forked (master)
$

关于git rev-parse HEAD 返回非零退出状态 128,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67225588/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com