怎样在cmd和powershell中使用git命令

2025-11-09 08:16:57

1、在安装git的时候把“Use git from the windows command prompt"的选择上

怎样在cmd和powershell中使用git命令

2、安装成功之后,打开cmd,输入git命令

怎样在cmd和powershell中使用git命令

1、安装好git,没有选择方法1中的选项,默认情况下在cmd里不能运行git命令

怎样在cmd和powershell中使用git命令

2、进入环境变量界面

(windows键+R) ->高级环境设置 -> 环境变量

怎样在cmd和powershell中使用git命令

怎样在cmd和powershell中使用git命令

怎样在cmd和powershell中使用git命令

3、选中Path项然后点击编辑

怎样在cmd和powershell中使用git命令

4、把git的安装目录C:\Program Files (x86)\Git\cmd加到最后,并确定。

然后到cmd里输入git命令就可以执行了

怎样在cmd和powershell中使用git命令

声明:本网站引用、摘录或转载内容仅供网站访问者交流或参考,不代表本站立场,如存在版权或非法内容,请联系站长删除,联系邮箱:site.kefu@qq.com。
猜你喜欢