无法通过 git clone 命令更新 git

Gok*_*kul 1 git software-installation

我正在阅读git 文档并使用源代码包安装 Git。现在,安装 Git 后,我​​想更新它(虽然此时可能没有必要,但我只想尝试确保它有效)。我运行了命令git clone git://git.kernel.org/pub/scm/git/git.git,它返回了 error -bash: /usr/bin/git: No such file or directory。原因可能很明显,因为为了安装 git,我使用了make prefix=/usr/local install安装 Git的命令/usr/local/bin/git

现在,如何解决这个问题?

我尝试使用相同的 git clone 命令--git-dir=/usr/local/bin/git返回相同的错误-bash: /usr/bin/git: No such file or directory

fro*_*utz 5

什么hash发言权?你/usr/bin/git以前有一个然后删除它吗?这将导致bash: /usr/bin/git: No such file or directory虽然hash仍然相信git在那里。

这种情况下的解决方案是使用新的外壳。或者对于每个带有旧散列的 shell,使用hash -r.