Working Directory : ファイルとかフォルダとか
Staging Area : repositoryにcommitする際の指示書みたいなもの
Repository : ファイル・フォルダの記録
https://git-scm.com/book/en/v2/Getting-Started-Git-Basics#The-Three-States
コマンドをインストール
$ brew install git
$ brew install hub
$ brew install gibo
SSH-Keyの設定(Githubとの連携のときに必要)
Generating a new SSH key and adding it to the ssh-agent
https://help.github.com/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent/
Adding a new SSH key to your GitHub account
https://help.github.com/articles/adding-a-new-ssh-key-to-your-github-account/
hubコマンドをgitコマンドとしてあつかう
eval "$(hub alias -s)"
みやすい git log が表示される
alias gittree='git log --oneline --graph --all --format="%x09 %Cred%h %Cgreen%cd %Cblue%s %d"'
tab を2回押すと補完される
source /usr/local/etc/bash_completion.d/git-completion.bash
.gitignore
のテンプレート
$ gibo macOS vim > .gitignore
.bashrc
に書くと楽な設定
コマンドプロンプトに現在のブランチを表示する
# http://qiita.com/caad1229/items/6d71d84933c8a87af0c4
function parse_git_branch {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ [\1]/'
}
function promps {
local BLUE='\[\033[01;34m\]'
local RED='\[\033[01;31m\]'
local GREEN='\[\033[01;32m\]'
local WHITE='\[\033[0;00m\]'
local GRAY='\[\033[01;37m\]'
PS1="${BLUE}\W${GREEN}\$(parse_git_branch)${BLUE}\$${WHITE} "
}
PROMPT_COMMAND='promps'