Skip to content

Instantly share code, notes, and snippets.

@KmolYuan
Last active September 26, 2025 08:08
Show Gist options
  • Select an option

  • Save KmolYuan/51087cc60207f8a358674fbf495aa8f3 to your computer and use it in GitHub Desktop.

Select an option

Save KmolYuan/51087cc60207f8a358674fbf495aa8f3 to your computer and use it in GitHub Desktop.
My git configuration
[core]
editor = code --wait
[pull]
rebase = true
[format]
pretty = %C(auto)%h %d %s
[log]
decorate = short
[fetch]
prune = true
pruneTags = true
[alias]
abort = "!f() { git status | grep -o 'git .* --abort' | bash -s; }; f"
amend = "!f() { if git diff --cached --quiet; then git add -A; fi; git commit --amend --no-edit; }; f"
between = "!f() { git --no-pager diff --shortstat $1...HEAD; }; f"
continue = rebase --continue
fix = "!f() { if git diff --cached --quiet; then git add -A; fi; git commit --fixup=$1; }; f"
jump = reset --hard
select = "!f() { git rebase -i $1; }; f"
squash = "!f() { git rebase -i $1 --autosquash; }; f"
to = checkout
tracking = for-each-ref --format='%(refname:short) <- %(upstream:short)' refs/heads
[pager]
branch = false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment