GitHubの設定
1 2 3 4 |
git config --local user.name ユーザー名 git config --local user.email メールアドレス 登録内容確認 git config --local --list |
コンソールにGitブランチを表示する
時間|カレントディレクトリ名[Gitブランチ名]
1 2 |
$ vi ~/.bashrc # Linux系 $ vi ~/.bash_profile # Mac |
vi画面で i を押してインサートモード後に以下を一番下の行にコピペ
1 2 3 4 5 6 7 8 9 10 11 12 13 |
function parse_git_branch { git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/[\1]/' } function date_format { date "+%H:%M:%S" } function promps { local BLUE="\[\e[1;34m\]" local GREEN="\[\e[1;32m\]" local WHITE="\[\e[00m\]" PS1="${WHITE}\$(date_format)|${BLUE}\W${GREEN}\$(parse_git_branch)${BLUE}\$${WHITE} " } promps |
[esc]を押して :wq を入力し[enter]
以下を実行するとコンソールの表示が変わる。
1 2 |
$ source ~/.bashrc # Linux系 $ source ~/.bash_profile # Mac |
Gitコマンド入力時にTABで保管できるようにする
保管してくれるスクリプトを検索
1 |
find / -name git-completion.bash |
毎回読み込むように記述しておく
1 2 |
$ vi ~/.bashrc # Linux系 $ vi ~/.bash_profile # Mac |
検索したgit-completion.bashのパスを以下のように最後の行に付け足す
1 |
source /Applications/Xcode.app/Contents/Developer/usr/share/git-core/git-completion.bash |
保存後に再読み込み
1 2 |
$ source ~/.bashrc # Linux系 $ source ~/.bash_profile # Mac |
Git操作用ツールの[tig]を使う
インストール手順
1 2 |
$ sudo apt-get install tig # Linux系 $ brew install tig # Mac |
tigの設定変更
1 2 3 4 5 |
vi ~/.tigrc 以下を追加 set vertical-split = yes |
これで縦分割されるようになります。
あとがき
だいたいLinuxかMacのどちらか、かつGithubを使用している。
いつもググるの面倒なのでメモしておく。
Windowns(笑)
全て二番煎じのまとめ。
参考
スポンサードリンク