Skip to content

Instantly share code, notes, and snippets.

@owen800q
Created October 24, 2019 03:47
Show Gist options
  • Save owen800q/1d304abd8ec8924080c9a5af4cf3940c to your computer and use it in GitHub Desktop.
Save owen800q/1d304abd8ec8924080c9a5af4cf3940c to your computer and use it in GitHub Desktop.
Git_cheatsheet.md

Show Nth commit logs from the beginning

Example, Show first 4 commit histroies from first inital commit

it log  --pretty=oneline | tail -n 4

Output

bf1ecfcf70c295d88fd38f3bea31fca7c65ccdaf Changes behaviour of ErrorLogger() and Logger()
40dc444270f1d12fa112f0f07900bb4c6d2816cf Renames ErrorRender() to ErrorLogger()
15651112744deb7659161383e6edb04d86093ff9 Fixes routing bug
d10e2b6c0dfcc8524cda504f11130bf78b7fe563 Improves README.md
15216a0883d113fadc33198d24850974eae0f841 Initial commit

Switch local repo to a specific commit

git checkout -b first_commit 15216a0883d113fadc33198d24850974eae0f841
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment