Code: Select all
Win:
C:\Users\username\.gitconfig
Linux:
~home/<username>/.gitconfig or ~root/.gitconfig
Set difftool to .gitconfig
Code: Select all
[diff]
tool = winmerge
[difftool "winmerge"]
cmd = "'C:/Program Files (x86)/WinMerge/WinMergeU.exe'" -e "$LOCAL" "$REMOTE"
Code: Select all
git config --global user.name “Your Name”
git config --local user.name “Your Name”
git config --global user.email “you@example.com”
git config --global alias.adog "log --all --decorate --oneline --graph"
git config --global alias.lg "log --pretty='%C(yellow)%h%Creset %s %Cgreen%cr%Creset %C(yellow)[%an]%Cred%d'"
git config --global pull.ff only -> fetch and mege only when fastforward merge is possible
Code: Select all
git clone
git init
git status
git stash
git stash list
git stash pop
git stash drop
git log
git log --oneline
git log --all --decorate --oneline --graph
Code: Select all
git branch <new-branch-name>
git branch --list <autocomplete>
git branch --merged master
git branch --no-merged master
git branch -m <old-branch-name> <new-branch-name>
git branch -r (list remote branches)
git checkout <branch-name/commit>
git checkout -b <branch-name>
Code: Select all
git diff (working tree <-> staging area)
git diff --staged (staging area <-> local repository)
git diff <commit> (working tree <-> local repository)