Skip to content

Instantly share code, notes, and snippets.

@Fendo181
Created July 2, 2017 02:22
Show Gist options
  • Save Fendo181/154efd022dd8ebefcd4b8eb472bf75c4 to your computer and use it in GitHub Desktop.
Save Fendo181/154efd022dd8ebefcd4b8eb472bf75c4 to your computer and use it in GitHub Desktop.

Gitの設定

ユーザ設定

git config --global color.ui true
git config --global user.name "YOUR NAME"
git config --global user.email "[email protected]"

ssh-keyの設定

ssh-keygen -t rsa -b 4096 -C "[email protected]"
cat ~/.ssh/id_rsa.pub

公開鍵をGithubのssh設定ページにコピーする。

最終確認

ssh -T [email protected]

このメッセージが来たらok

Hi excid3! You've successfully authenticated, but GitHub does not provide shell access.

gitのエイリアス設定

.gticonfig

[color]
    ui = true
[user]
    name = Fendo181
    email = [email protected]
[alias]
        a = add
        cm = commit
        cma = commit --amend
        st = status
        ss = status -s
        sh = show
        fe = fetch
        me = merge
        p  = push
        br = branch
        ch = checkout
        d  = diff
        d1 = diff HEAD~
        d2 = diff HEAD~2
        d3 = diff HEAD~3
#応用的エイリアス
        ta = log --graph --branches --pretty=format:'%C(yellow)%h%C(cyan)%d%Creset %s %C(green)- %an, %cr%Creset'
        ll = log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --numstat





[core]
    editor = vim -c \"set fenc=utf-8\"

Tips

  • コミットのlogをvimに設定する。
git config --global core.editor 'vim -c "set fenc=utf-8"'

参考資料 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment