Mac git指令无法执行相关问题
来源:互联网 发布:减肥淘宝排行榜 编辑:程序博客网 时间:2024/06/14 18:24
问题描述
在给Mac安装git时碰到一个问题,命令行无法执行git命令,提示
xcode-select: note: no developer tools were found at '/Applications/Xcode.app', requesting install. Choose an option in the dialog to download the command line developer tools.
并弹出如下对话框提示安装Xcode
原因分析
在Mac中,我安装了Xcode,安装Xcode时,会预装git wrapper,路径为:
/usr/bin/git
所以系统在执行git指令时先搜索到该路径,而本地安装的git路径为:
/usr/local/git/bin/git
解决方法
- 如果系统未安装Xcode,通过Xcode安装git
- 修改环境变量,将新的git路径写入系统环境变量
打开.bash_profile文件,将新的git路径写进去,保存
然后执行:$source ~/.bash_profile
PATH=/usr/local/git/bin:$PATHexport PATH
最后进行git测试,如果得到以下结果的话就ok了
参考
http://superuser.com/questions/666086/issues-installing-git-under-mac-os-x-10-9-mavericks
0 0
- Mac git指令无法执行相关问题
- git相关指令收藏
- MAC git github 常用指令
- CentOS 无法执行ftp指令
- git remote同步相关指令
- mac studio git 无法提交
- mac 10.11 git 问题
- 本地git以及网络gitHub相关指令
- git的安装与相关操作指令
- Git 指令的相关使用场景
- git 命令之暂存相关指令。
- 【git】 无法commit问题
- 【git】 无法commit问题
- Git相关问题
- git 相关问题 总汇
- git 相关问题
- [问题] mac执行git命令出现xcrun: error: invalid active developer path解决方法
- 修正 Vim(Mac) 有时无法正确提交 Git Commit Message 的问题
- 几个Linux distribution安装时可能用到的国内NTP server
- 数据结构(16)循环链表
- CentOS6下安装docker
- JavaScript笔记
- NYOJ 168 房间安排 (贪心)
- Mac git指令无法执行相关问题
- 【笔试】17、猴子吃桃问题
- HTML DOM笔记
- HNU13377:Book Club(DFS)
- HDU1503:Advanced Fruits 【LCS】
- 微信开发时,接收微信回调时,如果是传递流,请不要用参数接收
- C语言-Loop
- POJ 2352 Stars
- 消息机制