且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在Mac OS X Lion上安装另一个版本的Git

更新时间:2023-01-13 11:35:59

编辑〜/.profile,以便新git目录的路径位于旧git目录的路径之前,因此始终可以找到它(及其关联文件)第一的.否则,您会发现新的git将使用系统路径查找支持文件,并将获取旧git的文件,从而导致问题.

Edit ~/.profile so that the path to the new git directory is before the path to the old git directory so it always find it (and associated files) first. Without this, you will find that the new git will look for supporting files using the system path and will get the ones for the old git, causing a problem.

将此行添加到.profile

Add this line to .profile

export PATH=/path/to/new/git:$PATH

然后关闭并重新打开终端以重新加载终端,并回显$ PATH以进行检查.

Then close and reopen the terminal to reload it and do echo $PATH to check.