Skip to content

Instantly share code, notes, and snippets.

@myanbin
Created March 30, 2019 03:46
Show Gist options
  • Save myanbin/973f4a61d59cfe12b944413891b9733f to your computer and use it in GitHub Desktop.
Save myanbin/973f4a61d59cfe12b944413891b9733f to your computer and use it in GitHub Desktop.
[alias]
a = add
aa = add -A # Stage all changes.
amend = commit --amend
ap = add -p # Stage changes chunk by chunk
b = branch -v # Shorthand for branch (verbose)
ba = branch -av
c = commit
ca = !git add -A && git commit # Commit all changes.
co = checkout
d = diff # Diff unstaged changes
da = diff HEAD # Diff unstaged and staged changes
dc = diff --cached # Diff staged changes
ds = diff --stat
dw = diff --color-words # Show a word diff instead a line
dump = cat-file -p # Show content of git object
f = fetch
# Find commits by commit message
find = "!f() { git log --pretty=basic --name-status --grep=$1; }; f"
fixup = commit --fixup
g = log --graph --pretty=basic # Show basic graph.
git = !exec git # Allow `$ git git git...`
h = help # Shorthand for help
hi = !echo 'hello, welcome to use myanbin/dotfiles'
l = log --pretty=basic # Show basic log. (oneline)
ll = log --pretty=intermediate --stat # Show intermediate log.
m = merge
new = checkout -b # Create a new branch.
p = pull
pick = cherry-pick
pop = reset HEAD^ # Pop your last commit out of the history
r = remote -v # Shorthand for remote (verbose)
rc = rebase --continue
rs = rebase --skip
s = status
sh = show
type = cat-file -t # Show type of git object
undo = reset HEAD~ # Undo last commit, with files in uncommitted state
who = shortlog --no-merges --email --numbered --summary
zip = archive --format=zip -o latest.zip HEAD
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment