[Bookmark]Gitを使い始めたらやっておきたい便利な設定いろいろ


Gitを使い始めたらやっておきたい便利な設定いろいろ : アシアルブログ
Gitのセットアップで大変お世話になりました。

homebrew の git に変えたら「bashのプロンプトにGitのbranch名を表示させる。」が動かなかったので、
bash_completionで「-bash: __git_ps1: command not found」となった時の対処法 を参考に .bashrc に以下を追加したらOKでした。
[text]
source /usr/local/etc/bash_completion.d/git-prompt.sh
source /usr/local/etc/bash_completion.d/git-completion.bash
PS1="\h@\u:\W\$(__git_ps1) \$ "
[/text]

ちなみにmacportsのgitの場合は
[text]
source /opt/local/share/git-core/git-prompt.sh
source /opt/local/share/git-core//contrib/completion/git-completion.bash
PS1="\h@\u:\W\$(__git_ps1) \$ "
[/text]


Githubにsshキー登録

[bash]
$ ssh-keygen -t rsa -C hrendoh@gmail.com
Generating public/private rsa key pair.
Enter file in which to save the key (/Users/hrendoh/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /Users/hrendoh/.ssh/id_rsa.
Your public key has been saved in /Users/hrendoh/.ssh/id_rsa.pub.
The key fingerprint is:
f6:f6:24:b8:6d:3a:e6:73:2c:7d:d9:9d:29:3a:ce:21 hrendoh@gmail.com
The key’s randomart image is:
+–[ RSA 2048]—-+
| |
| |
| |
| |
| S |
| . o |
| .E+..o .o|
| =+B=+..o.|
| o+Bo=+ . |
+—————–+
[/bash]
~/.ssh/id_rsa.pubの内容を Key テキストボックスに貼付けて保存
SSH Keys