[user]
	name = Your Name
	email = your@email.com

[core]
	editor = vim
	whitespace = fix,-indent-with-non-tab,trailing-space
	excludesfile = ~/.gitignore_global
	pager = delta

[color]
	ui = auto
	diff = auto
	status = auto
	branch = auto
	interactive = auto

[push]
	default = current
	autoSetupRemote = true
	followTags = true

[pull]
	rebase = true

[rebase]
	autoStash = true
	updateRefs = true

[fetch]
	prune = true
	pruneTags = true

[merge]
	conflictstyle = zdiff3

[diff]
	algorithm = histogram
	renameLimit = 5000

[rerere]
	enabled = true
	autoUpdate = true

[help]
	autocorrect = 10

[init]
	defaultBranch = main

[alias]
	# ── Status & Info ──────────────────────────────────
	st = status -sb
	ll = log --oneline --decorate --graph -20
	lg = log --graph --pretty=format:'%C(yellow)%h%Creset %Cgreen(%cr)%Creset %C(bold blue)%an%Creset %C(auto)%d%Creset %s %C(red)%Creset' --abbrev-commit -20
	lf = log --graph --pretty=format:'%C(yellow)%h%Creset %Cgreen(%cr)%Creset %C(bold blue)%an%Creset %C(auto)%d%Creset %s %C(red)%Creset' --abbrev-commit --stat -10
	ls = log --graph --pretty=format:'%C(yellow)%h%Creset %Cgreen(%cr)%Creset %C(bold blue)%an%Creset %C(auto)%d%Creset %s %C(red)%Creset' --abbrev-commit --name-status -10
	who = shortlog -sne --all
	contributions = shortlog -sn --all --no-merges
	graph = log --graph --all --oneline --decorate

	# ── Branch Operations ──────────────────────────────
	br = branch
	bra = branch -a
	brm = branch -m
	brd = branch -d
	brD = branch -D
	co = checkout
	cob = checkout -b
	sw = switch
	swc = switch -c

	# ── Commit & Amend ─────────────────────────────────
	ci = commit
	cia = commit --amend --no-edit
	ciam = commit --amend -m
	fixup = commit --fixup
	undo = reset --soft HEAD~1
	redraft = reset HEAD~1 --soft  # undo commit but keep changes staged

	# ── Staging ────────────────────────────────────────
	ad = add
	adp = add -p
	ada = add -A
	unstage = reset HEAD --
	ignore = update-index --assume-unchanged
	noignore = update-index --no-assume-unchanged

	# ── Diff & Blame ───────────────────────────────────
	df = diff
	dfs = diff --cached
	dfw = diff --word-diff
	dfl = diff --name-only
	bl = blame -w -C -C -C

	# ── Stash ──────────────────────────────────────────
	sh = stash
	shl = stash list
	shp = stash pop
	sha = stash apply
	shd = stash drop
	shs = stash show -p
	shc = stash clear

	# ── Fetch & Pull & Push ────────────────────────────
	up = !git fetch --all --prune && git pull --rebase
	pl = pull --rebase
	ps = push
	psf = push --force-with-lease
	pst = push --tags
	psd = push --delete origin

	# ── Rebase ─────────────────────────────────────────
	rb = rebase
	rbi = rebase -i
	rbc = rebase --continue
	rba = rebase --abort
	rbs = rebase --skip

	# ── Reset ──────────────────────────────────────────
	rs = reset
	rsh = reset --hard
	rss = reset --soft
	rsm = reset --mixed

	# ── Cleanup ────────────────────────────────────────
	cleanup = !git branch --merged | grep -v '\\*\\|main\\|master\\|develop' | xargs -r git branch -d
	prune-branches = !git remote prune origin && git branch -vv | grep ': gone]' | awk '{print $1}' | xargs -r git branch -d
	orphans = !git fsck --lost-found | grep 'dangling commit' | cut -d' ' -f3 | xargs -r git show -s --oneline

	# ── Search ─────────────────────────────────────────
	find = !git ls-files | grep -i
	grep-log = log --all --oneline -i
	search = log --all -S
	find-commit = log --all --grep
	file-history = log --follow -p --
	my = shortlog --author="$(git config user.name)" -sn

	# ── Tag ────────────────────────────────────────────
	tags = tag -n --sort=-creatordate
	tag-release = !git tag -a "v$1" -m "Release v$1" && git push origin "v$1"
	tag-delete = !git tag -d "$1" && git push origin :refs/tags/"$1"

	# ── Utility ────────────────────────────────────────
	alias = !git config --list | grep 'alias\\.' | sed 's/alias\\.\\([^=]*\\)=\\(.*\\)/\\1\\t=> \\2/' | sort
	squash = !git rebase -i HEAD~"$1"
	nuke = !git clean -dfx && git reset --hard
	summary = !git log --format='%an: %s' --since="1 week ago"
	today = !git log --since=00:00 --format='%C(yellow)%h %Cgreen%cr %Creset%s' --author="$(git config user.name)"
	yesterday = !git log --since=yesterday --format='%C(yellow)%h %Cgreen%cr %Creset%s' --author="$(git config user.name)"
