Hope is a good thing.

タグ ‘git’ がついた投稿

git configファイルの設定

04/05/2009 · 1件のコメント

gitのconfig設定


$ git config --global user.name "my name"
$ git config --global user.email myemailaddress@example.com
$ git config --global color.diff auto
$ git config --global color.status auto
$ git config --global color.branch auto
$ git config --global color.interactive auto
$ git config --global --list
user.name=my name
user.email=myemailaddress@example.com
color.diff=auto
color.status=auto
color.branch=auto
color.interactive=auto

カテゴリー: Programming
タグ:

Create a New Repository at Github

04/05/2009 · コメントを書く

githubにリポジトリを作成する

「create a new one」をクリック

github new Repositories - GitHub

リポジトリ情報を埋める

fill repository info - GitHub

リポジトリが作成されるので、自分の開発環境でセッティング。

tutorial first commit - GitHub

表示された通りにやれば問題ない。
以下は実際の記録。


$ mkdir dotfiles
$ cd dotfiles/
matsuda:dotfiles matsuda$ git init
Initialized empty Git repository in /Users/matsuda/dev/dotfiles/.git/
$ touch README
$ git add README
$ git commit -m 'first commit'
[master (root-commit) 933f10d] first commit
 0 files changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 README
$ git remote add origin git@github.com:matsuda/dotfiles.git
$ git push origin master
Counting objects: 3, done.
Writing objects: 100% (3/3), 210 bytes, done.
Total 3 (delta 0), reused 0 (delta 0)
To git@github.com:matsuda/dotfiles.git
 * [new branch]      master -> master

ただし、公開鍵設定をしていないとpushで失敗する。
公開鍵の設定は
Guides: Providing your SSH Key
を参考に。



# $ ssh-keygen -t rsa
$ ssh-keygen
# ひたすらEnter
# Macコマンドでクリップボードにコピー
$ cat id_dsa.pub | pbcopy

githubの[account]→[SSH Public Keys]にコピペ


最後に「Continue」をクリックしたら、完了。

dotfiles at master - GitHub

カテゴリー: Programming
タグ:

TextMateにGit Textmate bundleをインストール

05/26/2008 · コメントを書く

TextMateのGit Textmate bundleをインストール。

Git Textmate bundleをgitでインストール


$ cd ~/Library/Application Support/TextMate/Bundles/
$ git clone git://gitorious.org/git-tmbundle/mainline.git Git.tmbundle

TextMateのbundleをリロード


$osascript -e 'tell app "TextMate" to reload bundles'

gitのコミットメッセージ用のエディターをTextMateに設定


$ emacs ~/.bashrc
export GIT_EDITOR="mate -w"

TextMateにTM_GIT変数を設定

TextMate-Preferences-Advanced-Shell Variablesを開いて
Variable : TM_GIT
Value : /opt/local/bin/git
を設定。
Valueについてはgitコマンドのあるところ。
自分の場合は、


$ which git
/opt/local/bin/git

カテゴリー: Mac · Programming
タグ: , ,

Mac OS Xにgitをインストール

05/25/2008 · コメントを書く

Macに今話題のgitをインストールする。

MacPortsにgitがあるか検索


$ port search git
cogito                         devel/cogito   0.18.2       Git core and cogito tools to provide a fully-distributed SCM
git-core                       devel/git-core 1.5.5.1      The stupid content tracker.
stgit                          devel/stgit    0.14.1       Push/pop utility on top of GIT
cgit                           www/cgit       0.7.1        A fast web interface for the git source code management system

git-coreをインストール


$ sudo port install git-core +svn +gitweb
--->  Fetching curl
--->  Attempting to fetch curl-7.18.1.tar.bz2 from http://curl.haxx.se/download/
--->  Verifying checksum(s) for curl
--->  Extracting curl
--->  Configuring curl
--->  Building curl with target all
--->  Staging curl into destroot
--->  Packaging tgz archive for curl 7.18.1_2
--->  Installing curl 7.18.1_2
--->  Activating curl 7.18.1_2
--->  Cleaning curl
--->  Fetching openssh
--->  Attempting to fetch DVG-5142987_launchd_DISPLAY_for_X11.patch from http://www.opensource.apple.com/darwinsource/10.5/OpenSSH-87/patches/
--->  Attempting to fetch openssh-5.0p1.tar.gz from http://mirror.roothell.org/pub/OpenBSD/OpenSSH/portable
--->  Verifying checksum(s) for openssh
--->  Extracting openssh
--->  Applying patches to openssh
--->  Configuring openssh
--->  Building openssh with target all
--->  Staging openssh into destroot
--->  Creating launchd control script
###########################################################
# A startup item has been generated that will aid in
# starting openssh with launchd. It is disabled
# by default. Execute the following command to start it,
# and to cause it to launch at startup:
#
# sudo launchctl load -w /Library/LaunchDaemons/org.macports.OpenSSH.plist
###########################################################
--->  Packaging tgz archive for openssh 5.0p1_0+darwin_9
--->  Installing openssh 5.0p1_0+darwin_9
--->  Activating openssh 5.0p1_0+darwin_9
--->  Cleaning openssh
--->  Fetching p5-error
--->  Attempting to fetch Error-0.17012.tar.gz from http://ftp.ucr.ac.cr/Unix/CPAN/modules/by-module/Error
--->  Verifying checksum(s) for p5-error
--->  Extracting p5-error
--->  Configuring p5-error
--->  Building p5-error with target all
--->  Staging p5-error into destroot
--->  Packaging tgz archive for p5-error 0.17012_0
--->  Installing p5-error 0.17012_0
--->  Activating p5-error 0.17012_0
--->  Cleaning p5-error
--->  Fetching p5-compress-raw-zlib
--->  Attempting to fetch Compress-Raw-Zlib-2.011.tar.gz from http://ftp.ucr.ac.cr/Unix/CPAN/modules/by-module/Compress
--->  Verifying checksum(s) for p5-compress-raw-zlib
--->  Extracting p5-compress-raw-zlib
--->  Configuring p5-compress-raw-zlib
--->  Building p5-compress-raw-zlib with target all
--->  Staging p5-compress-raw-zlib into destroot
--->  Packaging tgz archive for p5-compress-raw-zlib 2.011_0
--->  Installing p5-compress-raw-zlib 2.011_0
--->  Activating p5-compress-raw-zlib 2.011_0
--->  Cleaning p5-compress-raw-zlib
--->  Fetching p5-io-compress-base
--->  Attempting to fetch IO-Compress-Base-2.011.tar.gz from http://ftp.ucr.ac.cr/Unix/CPAN/modules/by-module/IO
--->  Verifying checksum(s) for p5-io-compress-base
--->  Extracting p5-io-compress-base
--->  Configuring p5-io-compress-base
--->  Building p5-io-compress-base with target all
--->  Staging p5-io-compress-base into destroot
--->  Packaging tgz archive for p5-io-compress-base 2.011_0
--->  Installing p5-io-compress-base 2.011_0
--->  Activating p5-io-compress-base 2.011_0
--->  Cleaning p5-io-compress-base
--->  Fetching p5-io-compress-zlib
--->  Attempting to fetch IO-Compress-Zlib-2.011.tar.gz from http://ftp.ucr.ac.cr/Unix/CPAN/modules/by-module/IO
--->  Verifying checksum(s) for p5-io-compress-zlib
--->  Extracting p5-io-compress-zlib
--->  Configuring p5-io-compress-zlib
--->  Building p5-io-compress-zlib with target all
--->  Staging p5-io-compress-zlib into destroot
--->  Packaging tgz archive for p5-io-compress-zlib 2.011_0
--->  Installing p5-io-compress-zlib 2.011_0
--->  Activating p5-io-compress-zlib 2.011_0
--->  Cleaning p5-io-compress-zlib
--->  Fetching p5-compress-zlib
--->  Attempting to fetch Compress-Zlib-2.011.tar.gz from http://ftp.ucr.ac.cr/Unix/CPAN/modules/by-module/Compress
--->  Verifying checksum(s) for p5-compress-zlib
--->  Extracting p5-compress-zlib
--->  Configuring p5-compress-zlib
--->  Building p5-compress-zlib with target all
--->  Staging p5-compress-zlib into destroot
--->  Packaging tgz archive for p5-compress-zlib 2.011_0
--->  Installing p5-compress-zlib 2.011_0
--->  Activating p5-compress-zlib 2.011_0
--->  Cleaning p5-compress-zlib
--->  Fetching p5-html-tagset
--->  Attempting to fetch HTML-Tagset-3.20.tar.gz from http://ftp.ucr.ac.cr/Unix/CPAN/modules/by-module/HTML
--->  Verifying checksum(s) for p5-html-tagset
--->  Extracting p5-html-tagset
--->  Configuring p5-html-tagset
--->  Building p5-html-tagset with target all
--->  Staging p5-html-tagset into destroot
--->  Packaging tgz archive for p5-html-tagset 3.20_0
--->  Installing p5-html-tagset 3.20_0
--->  Activating p5-html-tagset 3.20_0
--->  Cleaning p5-html-tagset
--->  Fetching p5-html-parser
--->  Attempting to fetch HTML-Parser-3.56.tar.gz from http://ftp.ucr.ac.cr/Unix/CPAN/modules/by-module/HTML
--->  Verifying checksum(s) for p5-html-parser
--->  Extracting p5-html-parser
--->  Configuring p5-html-parser
--->  Building p5-html-parser with target all
--->  Staging p5-html-parser into destroot
--->  Packaging tgz archive for p5-html-parser 3.56_0
--->  Installing p5-html-parser 3.56_0
--->  Activating p5-html-parser 3.56_0
--->  Cleaning p5-html-parser
--->  Fetching p5-uri
--->  Attempting to fetch URI-1.35.tar.gz from http://ftp.ucr.ac.cr/Unix/CPAN/modules/by-module/URI
--->  Verifying checksum(s) for p5-uri
--->  Extracting p5-uri
--->  Configuring p5-uri
--->  Building p5-uri with target all
--->  Staging p5-uri into destroot
--->  Packaging tgz archive for p5-uri 1.35_1
--->  Installing p5-uri 1.35_1
--->  Activating p5-uri 1.35_1
--->  Cleaning p5-uri
--->  Fetching p5-libwww-perl
--->  Attempting to fetch libwww-perl-5.812.tar.gz from http://ftp.ucr.ac.cr/Unix/CPAN/modules/by-module/LWP
--->  Verifying checksum(s) for p5-libwww-perl
--->  Extracting p5-libwww-perl
--->  Configuring p5-libwww-perl
--->  Building p5-libwww-perl with target all
--->  Staging p5-libwww-perl into destroot
--->  Packaging tgz archive for p5-libwww-perl 5.812_0
--->  Installing p5-libwww-perl 5.812_0
--->  Activating p5-libwww-perl 5.812_0
--->  Cleaning p5-libwww-perl
--->  Fetching subversion-perlbindings
--->  Verifying checksum(s) for subversion-perlbindings
--->  Extracting subversion-perlbindings
--->  Configuring subversion-perlbindings
--->  Building subversion-perlbindings with target swig-pl
--->  Staging subversion-perlbindings into destroot
--->  Packaging tgz archive for subversion-perlbindings 1.4.6_0
--->  Installing subversion-perlbindings 1.4.6_0
--->  Activating subversion-perlbindings 1.4.6_0
--->  Cleaning subversion-perlbindings
--->  Fetching p5-svn-simple
--->  Attempting to fetch SVN-Simple-0.27.tar.gz from http://cpan.perl.org/authors/id/C/CL/CLKAO/
--->  Verifying checksum(s) for p5-svn-simple
--->  Extracting p5-svn-simple
--->  Configuring p5-svn-simple
--->  Building p5-svn-simple with target all
--->  Staging p5-svn-simple into destroot
--->  Packaging tgz archive for p5-svn-simple 0.27_0
--->  Installing p5-svn-simple 0.27_0
--->  Activating p5-svn-simple 0.27_0
--->  Cleaning p5-svn-simple
--->  Fetching p5-term-readkey
--->  Attempting to fetch TermReadKey-2.30.tar.gz from http://ftp.ucr.ac.cr/Unix/CPAN/modules/by-module/Term
--->  Verifying checksum(s) for p5-term-readkey
--->  Extracting p5-term-readkey
--->  Configuring p5-term-readkey
--->  Building p5-term-readkey with target all
--->  Staging p5-term-readkey into destroot
--->  Packaging tgz archive for p5-term-readkey 2.30_0
--->  Installing p5-term-readkey 2.30_0
--->  Activating p5-term-readkey 2.30_0
--->  Cleaning p5-term-readkey
--->  Fetching popt
--->  Attempting to fetch popt-1.13.tar.gz from http://rpm5.org/files/popt/
--->  Verifying checksum(s) for popt
--->  Extracting popt
--->  Configuring popt
--->  Building popt with target all
--->  Staging popt into destroot
--->  Packaging tgz archive for popt 1.13_0
--->  Installing popt 1.13_0
--->  Activating popt 1.13_0
--->  Cleaning popt
--->  Fetching rsync
--->  Attempting to fetch rsync-3.0.2.tar.gz from http://rsync.samba.org/ftp/rsync/
--->  Verifying checksum(s) for rsync
--->  Extracting rsync
--->  Configuring rsync
--->  Building rsync with target all
--->  Staging rsync into destroot
--->  Packaging tgz archive for rsync 3.0.2_0
--->  Installing rsync 3.0.2_0
--->  Activating rsync 3.0.2_0
--->  Cleaning rsync
--->  Fetching git-core
--->  Attempting to fetch git-1.5.5.1.tar.bz2 from http://www.kernel.org/pub/software/scm/git/
--->  Attempting to fetch git-manpages-1.5.5.1.tar.bz2 from http://www.kernel.org/pub/software/scm/git/
--->  Attempting to fetch git-htmldocs-1.5.5.1.tar.bz2 from http://www.kernel.org/pub/software/scm/git/
--->  Verifying checksum(s) for git-core
--->  Extracting git-core
--->  Applying patches to git-core
--->  Configuring git-core
--->  Building git-core with target all gitweb/gitweb.cgi
--->  Staging git-core into destroot
--->  Packaging tgz archive for git-core 1.5.5.1_0+doc+gitweb+svn
--->  Installing git-core 1.5.5.1_0+doc+gitweb+svn
--->  Activating git-core 1.5.5.1_0+doc+gitweb+svn
--->  Cleaning git-core

cogitoをインストール


$ sudo port install cogito
--->  Fetching coreutils
--->  Attempting to fetch coreutils-6.11.tar.gz from http://ftp.gnu.org/gnu/coreutils
--->  Verifying checksum(s) for coreutils
--->  Extracting coreutils
--->  Configuring coreutils
--->  Building coreutils with target all
--->  Staging coreutils into destroot
--->  Packaging tgz archive for coreutils 6.11_0+darwin_9
--->  Installing coreutils 6.11_0+darwin_9
--->  Activating coreutils 6.11_0+darwin_9
--->  Cleaning coreutils
--->  Fetching cogito
--->  Attempting to fetch cogito-0.18.2.tar.bz2 from http://kernel.org/pub/software/scm/cogito/
--->  Verifying checksum(s) for cogito
--->  Extracting cogito
--->  Applying patches to cogito
--->  Configuring cogito
--->  Building cogito with target all
--->  Staging cogito into destroot
Error: Target org.macports.destroot returned: shell command " cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_devel_cogito/work/cogito-0.18.2" && gnumake install prefix=/opt/local DESTDIR=/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_devel_cogito/work/destroot " returned error 2
Command output: m755 -d /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_devel_cogito/work/destroot/opt/local/bin
gnumake: m755: Command not found
gnumake: [install-cogito] Error 127 (ignored)
cg-object-id cg-add cg-admin-lsobj cg-admin-uncommit cg-branch-add cg-branch-ls cg-reset cg-clone cg-commit cg-diff cg-export cg-help cg-init cg-log cg-merge cg-mkpatch cg-patch cg-fetch cg-restore cg-rm cg-seek cg-status cg-tag cg-tag-ls cg-update cg cg-admin-ls cg-push cg-branch-chg cg-admin-cat cg-clean cg-admin-setuprepo cg-switch cg-mv cg-admin-rewritehist cg-tag-show cg-version /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_devel_cogito/work/destroot/opt/local/bin
gnumake: cg-object-id: Command not found
gnumake: *** [install-cogito] Error 127

Error: Status 1 encountered during processing.

なんかエラーが発生した。
ググったら例えばerror installing cogitoというページを発見。
どうももう一回コマンド叩けばうまくいくかもって書いてあるので再度実行。


$ sudo port install cogito
--->  Staging cogito into destroot
--->  Packaging tgz archive for cogito 0.18.2_1
--->  Installing cogito 0.18.2_1
--->  Activating cogito 0.18.2_1
--->  Cleaning cogito

うまくいった。

カテゴリー: Mac · Programming
タグ: ,