Skip to content

Instantly share code, notes, and snippets.

@misTrasteos
Last active October 26, 2022 11:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save misTrasteos/3021ed83168ce593702ecbe144fff212 to your computer and use it in GitHub Desktop.
Save misTrasteos/3021ed83168ce593702ecbe144fff212 to your computer and use it in GitHub Desktop.
Git cheat sheet

git config

alias

git config --global alias.l 'log --oneline'

git commit

--amend Replace the tip of the current branch by creating a new commit

--allow-empty

-a, --all Tell the command to automatically stage files that have been modified and deleted, but new files you have not told Git about are not affected.

git diff

--name-only Show only names of changed files

--name-status Show only names and status of changed files

git log

Pretty formats

git log --pretty=format:"%C(yellow)%as%Creset, %Cgreen%h%Creset %Cred%d%Creset, %Cblue%sCreset, %an"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment