LoginSignup
4
4

More than 5 years have passed since last update.

git周り設定いろいろメモ

Posted at

自分で何を設定したか忘れかけてたのでメモ

  • .gitconfigの内容
vi ~/.gitconfig

#ログをグラフィカルに
[alias]
  graph = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative
  graphall = log --graph --all --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative

#色はいい感じに
[color]
        ui = auto
  • コマンドで今いるブランチを表示させる
vi ~/.bash_profile

# git settings
source ~/local/etc/bash_completion.d/git-prompt.sh
source ~/.git-completion.bash
GIT_PS1_SHOWDIRTYSTATE=true
PS1='\[\033[40;1;32m\]\u\[\033[2;32m\]@\[\033[0m\]\[\033[40;32m\]\h \[\033[1;36m\]\w \[\033[31m\]$(__git_ps1 "[%s]")\[\033[00m\] \[\033[0m\]\[\033[40;2;37m\]`date +"%Y/%m/%d %p %H:%M:%S"` \[\033[0m\]\n\\$ '
export PS1=$PS1
  • sublime text2で、左下に今いるブランチを表示させる

たしか、gitパッケージを入れたら自然と表示されるようになった気がする・・・

4
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
4