I blogged about this previously so I had already done some research about installing MacPorts on a computer and I knew that I'd need to install the command-line tools for XCode first. So I installed XCode first using the App Store and then followed the instructions to install the XCode command-line tools. Once these were installed, then I was able to proceed with the installation of MacPorts.
So I downloaded and installed MacPorts, ran sudo port selfupdate followed by sudo port install bash to get the latest version of bash. So that the OS can make use of this newer version of bash, I added it to the On MacOS X, I added the path to this newer version of bash to the /etc/shells file. To actually make use of this updated version of bash, I had to make my terminal aware of it. I always use iterm2 instead of the Apple terminal, it's just so much more powerful. So I changed my profile in iterm2 to launch this version of bash by adding the bash login command to be run when iterm2 opens a new terminal, /opt/local/bin/bash -l. Now when iterm2 starts up, it logs in to this newer version of bash automatically for me. Now I'm ready to install the git tools.
To install git, I run the following command in the terminal that I've always run to install git via MacPorts:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ sudo port install git-core +bash_completion +doc +svn | |
--> Configuring git-core | |
Error: git-core has been made obsolete by the port git. Please install git instead. | |
Error: org.macports.configure for port git-core returned: obsolete port | |
Please see the log file for port git-core for details: | |
> /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_git-core/git-core/main.log | |
To report a bug, follow the instructions in the guide: | |
http://guide.macports.org/#project.tickets | |
Error: Processing of port git-core failed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ sudo port install git-core +bash_completion +doc +svn |
However, the git bash completion didn't seen to work. I was seeing the following error from my .bash_profile when the bash prompt was getting set up:
bash: __git_ps1: command not found
It turns out, because the name of git in MacPorts was changed from git-core to just git, the paths to some of the git bash completion had changed as well. All I really had to do was update my .bash_profile from this:
/opt/local/share/git-core/contrib/completion/git-completion.bash
to this:
/opt/local/share/git/contrib/completion/git-completion.bash
and everything worked correctly.
No comments:
Post a Comment