.gitconfig
.gitconfig
~/.gitconfig
git config --list
user, email
1 | git config --global user.name "Lin Yun Wen" |
ssh key
difftool
command
git difftool [<options>] [<commit> [<commit>]] [--] [<path>…]
git difftool --tool=vimdiff --no-prompt
set diff tool with vim
1
2
3git config --global diff.tool vimdiff
git config --global difftool.prompt false
git config --global alias.d difftool1
2
3
4
5
6
7
8
9Git accepts kdiff3, tkdiff, meld, xxdiff, emerge, vimdiff, gvimdiff, ecmerge, and opendiff as valid diff tools. You can also set up a custom tool.
git config --global diff.tool vimdiff>
git config --global diff.tool kdiff3>
git config --global diff.tool meld>
git config --global diff.tool xxdiff>
git config --global diff.tool emerge>
git config --global diff.tool gvimdiff>
git config --global diff.tool ecmerge
vimdiff
1 | dp - diffput: puts changes under the cursor into the other file making them identical (thus removing the diff). |
alias
git config alias.lg 'log --all --decorate --oneline --graph'
1 | [alias] |
1 | lg = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit |
- remove
git config --global --unset alias.co