Difference between revisions of "Git cheatsheet"

From Wasya Wiki
Jump to: navigation, search
(show one commit)
Line 6: Line 6:
  
 
=== show one commit ===
 
=== show one commit ===
git diff <commit>~ <commit>
+
git diff <commit>~ <commit>
  
 
=== check branch ===
 
=== check branch ===

Revision as of 22:09, 17 July 2018

Git cheatsheet - nifty git usage example.

show history for a file

git log --follow -p -- file

show one commit

git diff <commit>~ <commit>

check branch

git branch | grep -e "^*" | cut -d' ' -f 2

see most recent branch

git branch -a --sort=-committerdate
git branch -a --sort=committerdate

What's the latest commit in the branch?

git log -n 1 <branchname> --format=format:%ci

list conflicting files

git diff --name-only --diff-filter=U