Snow LeopardにGitをインストール

MacPortsでインストールする場合のportnameを調べる

bash-3.2$ sudo port search git
...

何やらいっぱいでてきたが、git-core,cgitをインストールすることにした。

Mac Portsでのインストールオプション確認

bash-3.2$ sudo port variants git-core
Password:
git-core has the variants:
   bash_completion: Completion support for bash
[+]doc: Install HTML and plaintext documentation
   gitweb: Install gitweb.cgi
   svn: Bi-directional subversion repository support

bash-completionとgitwebを付けることにする。

bash-3.2$ sudo port variants cgit
cgit has no variants

インストール実施

以下、少し長くなるがログとして残すために画面の表示内容を記す。

bash-3.2$ sudo port install git-core +bash_completion +gitweb
      • > Computing dependencies for git-core
      • > Fetching bash-completion
      • > Attempting to fetch bash-completion-1.1.tar.gz from http://distfiles.macports.org/bash-completion
      • > Verifying checksum(s) for bash-completion
      • > Extracting bash-completion
      • > Applying patches to bash-completion
      • > Configuring bash-completion
      • > Building bash-completion
      • > Staging bash-completion into destroot
      • > Installing bash-completion @1.1_2
To use bash_completion, add the following lines at the end of your .bash_profile: if [ -f /opt/local/etc/bash_completion ]; then . /opt/local/etc/bash_completion fi
      • > Activating bash-completion @1.1_2
      • > Cleaning bash-completion
      • > Fetching pkgconfig
      • > Attempting to fetch pkg-config-0.23.tar.gz from http://distfiles.macports.org/pkgconfig
      • > Verifying checksum(s) for pkgconfig
      • > Extracting pkgconfig
      • > Configuring pkgconfig
      • > Building pkgconfig
      • > Staging pkgconfig into destroot
      • > Installing pkgconfig @0.23_1
      • > Activating pkgconfig @0.23_1
      • > Cleaning pkgconfig
      • > Fetching curl
      • > Attempting to fetch curl-7.19.6.tar.bz2 from http://www.execve.net/curl/
      • > Verifying checksum(s) for curl
      • > Extracting curl
      • > Configuring curl
      • > Building curl
      • > Staging curl into destroot
      • > Installing curl @7.19.6_0
      • > Activating curl @7.19.6_0
      • > Cleaning curl
      • > Fetching expat
      • > Attempting to fetch expat-2.0.1.tar.gz from http://nchc.dl.sourceforge.net/expat
      • > Verifying checksum(s) for expat
      • > Extracting expat
      • > Configuring expat
      • > Building expat
      • > Staging expat into destroot
      • > Installing expat @2.0.1_0
      • > Activating expat @2.0.1_0
      • > Cleaning expat
      • > Fetching gperf
      • > Attempting to fetch gperf-3.0.4.tar.gz from ftp://ftp.dti.ad.jp/pub/GNU/gperf
      • > Verifying checksum(s) for gperf
      • > Extracting gperf
      • > Configuring gperf
      • > Building gperf
      • > Staging gperf into destroot
      • > Installing gperf @3.0.4_0
      • > Activating gperf @3.0.4_0
      • > Cleaning gperf
      • > Fetching libiconv
      • > Attempting to fetch libiconv-1.13.tar.gz from ftp://ftp.dti.ad.jp/pub/GNU/libiconv
      • > Verifying checksum(s) for libiconv
      • > Extracting libiconv
      • > Applying patches to libiconv
      • > Configuring libiconv
      • > Building libiconv
      • > Staging libiconv into destroot
      • > Installing libiconv @1.13_0
      • > Activating libiconv @1.13_0
      • > Cleaning libiconv
      • > Fetching perl5.8
      • > Attempting to fetch perl-5.8.9.tar.bz2 from http://distfiles.macports.org/perl5.8
      • > Verifying checksum(s) for perl5.8
      • > Extracting perl5.8
      • > Applying patches to perl5.8
      • > Configuring perl5.8
      • > Building perl5.8
      • > Staging perl5.8 into destroot
      • > Installing perl5.8 @5.8.9_3
      • > Activating perl5.8 @5.8.9_3
      • > Cleaning perl5.8
      • > Fetching perl5
      • > Verifying checksum(s) for perl5
      • > Extracting perl5
      • > Configuring perl5
      • > Building perl5
      • > Staging perl5 into destroot
      • > Installing perl5 @5.8.9_0
      • > Activating perl5 @5.8.9_0
      • > Cleaning perl5
      • > Fetching p5-error
      • > Attempting to fetch Error-0.17015.tar.gz from ftp://ftp.cpan.org/pub/CPAN/modules/by-module/Error
      • > Verifying checksum(s) for p5-error
      • > Extracting p5-error
      • > Configuring p5-error
      • > Building p5-error
      • > Staging p5-error into destroot
      • > Installing p5-error @0.17015_0
      • > Activating p5-error @0.17015_0
      • > Cleaning p5-error
      • > Fetching gettext
      • > Attempting to fetch gettext-0.17.tar.gz from ftp://ftp.dti.ad.jp/pub/GNU/gettext
      • > Verifying checksum(s) for gettext
      • > Extracting gettext
      • > Applying patches to gettext
      • > Configuring gettext
      • > Building gettext
      • > Staging gettext into destroot
      • > Installing gettext @0.17_4
      • > Activating gettext @0.17_4
      • > Cleaning gettext
      • > Fetching popt
      • > Attempting to fetch popt-1.15.tar.gz from http://distfiles.macports.org/popt
      • > Verifying checksum(s) for popt
      • > Extracting popt
      • > Configuring popt
      • > Building popt
      • > Staging popt into destroot
      • > Installing popt @1.15_0
      • > Activating popt @1.15_0
      • > Cleaning popt
      • > Fetching rsync
      • > Attempting to fetch rsync-3.0.6.tar.gz from http://distfiles.macports.org/rsync
      • > Verifying checksum(s) for rsync
      • > Extracting rsync
      • > Applying patches to rsync
      • > Configuring rsync
      • > Building rsync
      • > Staging rsync into destroot
      • > Installing rsync @3.0.6_0
      • > Activating rsync @3.0.6_0
      • > Cleaning rsync
      • > Fetching git-core
      • > Attempting to fetch git-1.6.5.tar.bz2 from http://distfiles.macports.org/git-core
      • > Attempting to fetch git-manpages-1.6.5.tar.bz2 from http://distfiles.macports.org/git-core
      • > Attempting to fetch git-htmldocs-1.6.5.tar.bz2 from http://distfiles.macports.org/git-core
      • > Verifying checksum(s) for git-core
      • > Extracting git-core
      • > Applying patches to git-core
      • > Configuring git-core
      • > Building git-core
      • > Staging git-core into destroot
      • > Installing git-core @1.6.5_0+bash_completion+doc+gitweb
      • > Activating git-core @1.6.5_0+bash_completion+doc+gitweb
      • > Cleaning git-core
bash-3.2$
bash-3.2$ sudo port install cgit
Password:
      • > Computing dependencies for cgit
      • > Fetching cgit
      • > Attempting to fetch cgit-0.8.2.1.tar.bz2 from http://distfiles.macports.org/git-core
      • > Attempting to fetch git-1.6.3.tar.bz2 from http://distfiles.macports.org/git-core
      • > Verifying checksum(s) for cgit
      • > Extracting cgit
      • > Configuring cgit
      • > Building cgit
      • > Staging cgit into destroot
      • > Installing cgit @0.8.2.1_0
      • > Activating cgit @0.8.2.1_0
      • > Cleaning cgit
bash-3.2$

gitコマンドをたたいてみた

bash-3.2$ git
usage: git [--version] [--exec-path[=GIT_EXEC_PATH]] [--html-path]
           [-p|--paginate|--no-pager]
           [--bare] [--git-dir=GIT_DIR] [--work-tree=GIT_WORK_TREE]
           [--help] COMMAND [ARGS]

The most commonly used git commands are:
   add        Add file contents to the index
   bisect     Find by binary search the change that introduced a bug
   branch     List, create, or delete branches
   checkout   Checkout a branch or paths to the working tree
   clone      Clone a repository into a new directory
   commit     Record changes to the repository
   diff       Show changes between commits, commit and working tree, etc
   fetch      Download objects and refs from another repository
   grep       Print lines matching a pattern
   init       Create an empty git repository or reinitialize an existing one
   log        Show commit logs
   merge      Join two or more development histories together
   mv         Move or rename a file, a directory, or a symlink
   pull       Fetch from and merge with another repository or a local branch
   push       Update remote refs along with associated objects
   rebase     Forward-port local commits to the updated upstream head
   reset      Reset current HEAD to the specified state
   rm         Remove files from the working tree and from the index
   show       Show various types of objects
   status     Show the working tree status
   tag        Create, list, delete or verify a tag object signed with GPG

See 'git help COMMAND' for more information on a specific command.

使い方覚えねば・・・

参考URL
MacPortsを使ってgitをインストールしてみた