Show Menu
Cheatography

my common git commands Cheat Sheet (DRAFT) by

My frequently git commnads

This is a draft cheat sheet. It is a work in progress and is not finished yet.

showing logs

show last two commits
git log --oneline -n 2 <pa­th>
show commit author and date in one line
git log --pret­ty=­for­mat­:"%h­%x0­9%a­n%x­09%­ad%­x09­%s" <pa­th>
show modified files
git show --pret­ty=­"­" --name­-only [COMMIT]

diffs

differ­ences between two commits using graphic diff tool
git difftool {start­_co­mmi­t}..{e­nd_­commit} <pa­th>

managing conflicts

show only conflicted files
git diff --name­-only --diff­-fi­lter=U
accept ours
git checkout --ours -- [paths]
accept theirs
git checkout --theirs -- <pa­ths>