~kris/dots

srice

ref: e98f3b030dc24445bd55c68d95d2d81933fd68b3 srice/.config/git/git-aliases.gitconfig -rw-r--r-- 2.0 KiB
e98f3b03 — Kris Yotam chore: sync local state after restore (push updates, no pull) a month ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# git aliases for .gitconfig
# Add to ~/.gitconfig:
#   [include]
#       path = ~/dev/100x/configs/git-aliases.gitconfig

[alias]
    st = status -sb
    co = checkout
    cb = checkout -b
    sw = switch
    swc = switch -c
    ci = commit
    ca = commit --amend --no-edit
    cm = commit -m
    d = diff
    dc = diff --cached
    dw = diff --word-diff
    dn = diff --name-only
    unstage = reset HEAD
    undo = reset --soft HEAD~1
    fp = push --force-with-lease
    wip = "!git add -A && git commit -m \"WIP: $(date +%H:%M)\""
    lg = log --graph --abbrev-commit --decorate --all --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)'
    lol = log --graph --oneline --decorate --all
    who = shortlog -sn --all
    today = "!git log --since=midnight --author=\"$(git config user.name)\" --oneline"
    week = "!git log --since='1 week ago' --author=\"$(git config user.name)\" --oneline --stat"
    cleanup = "!git branch --merged main | grep -v 'main\\|master\\|\\*' | xargs -r git branch -d"
    # Find branches containing commit
    fb = "!f() { git branch -a --contains $1; }; f"
    # Find commits by message
    fm = "!f() { git log --all --oneline --grep=$1; }; f"
    # Contributors (ranked)
    contrib = shortlog -sn --all --no-merges
    # Diff stat
    ds = diff --stat
    # Last commit
    last = log -1 HEAD --stat
    # Remote URL
    url = config --get remote.origin.url
    # Assume unchanged (for local config files)
    assume = update-index --assume-unchanged
    unassume = update-index --no-assume-unchanged
    assumed = "!git ls-files -v | grep ^h | cut -c 3-"
    # Stash all (including untracked)
    stashall = stash --include-untracked
    # Diff of last commit
    dlc = diff HEAD~1..HEAD

[rebase]
    autoSquash = true
    autoStash = true

[rerere]
    enabled = true

[merge]
    conflictstyle = zdiff3

[pull]
    rebase = true

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

[fetch]
    prune = true
    pruneTags = true