Linux用户可以在安装后访问git客户端...

时间:2023-02-10 19:23:04

I installed git using the following steps

我使用以下步骤安装了git

wget https://www.kernel.org/pub/software/scm/git/git-1.8.2.3.tar.gz
tar xzvf git-1.8.2.3.tar.gz
cd git-1.8.2.3
make prefix=/usr/local all
sudo make prefix=/usr/local install

After doing the above I tye in

做完上述后我就进去了

git --version

and I get the following error

我收到以下错误

-bash: git: command not found

but it works if I sudo su and then try?

但是如果我sudo su然后尝试它可行吗?

1 个解决方案

#1


1  

You probably don't have /usr/local/bin in you PATH environment variable. Try:

您可能在PATH环境变量中没有/ usr / local / bin。尝试:

PATH=$PATH:/usr/local/bin git --version

If that works you can add it permanently by editing yoou .profile or .bash_profile and adding:

如果可行,您可以通过编辑yoou .profile或.bash_profile并添加以下内容来永久添加:

export PATH=$PATH:/usr/local/bin

#1


1  

You probably don't have /usr/local/bin in you PATH environment variable. Try:

您可能在PATH环境变量中没有/ usr / local / bin。尝试:

PATH=$PATH:/usr/local/bin git --version

If that works you can add it permanently by editing yoou .profile or .bash_profile and adding:

如果可行,您可以通过编辑yoou .profile或.bash_profile并添加以下内容来永久添加:

export PATH=$PATH:/usr/local/bin