警告: git command could not be found. Please create an alias or add it to yo

本文介绍了一种解决GitHub更新后导致GitShell无法正常使用的问题的方法。只需遵循简单的三步操作:关闭GitShell,打开GitHub应用,再次打开GitShell即可解决大部分情况下的问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

5 Answers

up vote  57  down vote accepted

It sounds like you recently updated GitHub application and Git Shell is now broken.

Short version

To fix it

  • close Git Shell
  • open GitHub and let it do some post installation.
  • Open Git Shell again and you should be fixed.
其实出现这个问题很可能是因为使用github for windows 的小伙伴更新了git shell所产生的。
上面的三点其实就是三个步骤:
1)关闭git shell 
2)打开gitHub
3)重新打开Gitshell即可

其实照着上面的做就行了。如果不行的再照着下面的尝试一下哈~~~~(因为我照着上面的做就解决问题了)


Long version

This just happened to me and just to make sure I follow you, you just did this

  • Open Git Shell
  • You are prompted to update GitHub
  • After the update, Git Shell opens

Now it gives the error

git command could not be found. Please create an alias or add it to your PATH.

Warning: Could not find ssh-agent.

If this is the case, do this

  • Close Git Shell
  • Now open the GitHub application (not Git Shell).

This will say something along the lines of (not sure of the exact version)

GitHub is extracting git..

Let that go through the process and after it is complete, go open Git Shell and it is fixed. Just worked for me at least.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

帅气的东哥

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值