ruk·si

📁 Git
Config

Updated at 2022-11-01 15:01

Just my general .gitconfig

https://git-scm.com/docs/git-config

[core]
        user = ruksi
        email = me@ruk.si
        excludesfile = /home/ruksi/.gitignore_global
        autocrlf = input
[user]
        name = ruksi
        email = me@ruk.si
[init]
        defaultBranch = main
[push]
        default = simple
[alias]
        rehead = remote set-head origin --auto
        main-branch = "!git symbolic-ref refs/remotes/origin/HEAD | cut -d'/' -f4"
        a = add
        aa = add .
        ap = add -p
        b = "!git for-each-ref --sort='-authordate' --format='%(authordate)%09%(objectname:short)%09%(refname)' refs/heads | sed -e 's-refs/heads/--'"
        bm = branch -m
        bd = branch -d
        c = commit
        cm = commit -m
        ca = commit --amend
        co = checkout
        cob = checkout -b
        cobra = "!f() { git checkout -b `head /dev/urandom | tr -dc a-z | head -c 8`; }; f"
        com = "!f(){ git checkout $(git main-branch) $@;}; f"
        d = diff
        ds = diff --stat
        dc = diff --cached
        dd = diff HEAD
        l = log --pretty=format:"%C(yellow)%h\\ %ad%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --date=short
        la = "!git config -l | grep alias | cut -c 7-"
        pf = push -f
        pushtags = push --tags
        pushnew = "!git push --set-upstream origin \"$(git rev-parse --abbrev-ref HEAD)\""
        pushf = push -f
        rhead = reset HEAD~
        r = remote -v
        ra = remote add
        rao = remote add origin
        rb = rebase
        rbm = "!f(){ git rebase $(git main-branch) $@;}; f"
        rbi = rebase -i
        rbim = "!f(){ git rebase -i $(git main-branch) $@;}; f"
        rbir = rebase -i --root
        rba = rebase --abort
        rbc = rebase --continue
        t = tag -l
        s = status
        sl = stash list
        sp = stash pop
        ss = stash save
[merge]
        ff = only
[rebase]
        autosquash = true