Tips on using git

Global configs

Changing the default branch name

for me I like to use my username as the default branch name

[init]
    defaultBranch = shironeko

Automatically rebase local changes when you pull a remote

This avoids creating lots of useless merge commits

[pull]
    rebase = true

Per-repo configs

Pushing to multiple remotes at once

Hate that github is owned by M$ but people only try to find your stuff there? Don't really trust gitlab either? Why not use them all so if any bursts into flames you don't really need to care.

[remote "origin"]
    # you need to pick one service that you will pull from, this is probably the
    # forge you like the most
    url = git@git.sr.ht:~shironeko/repo
    # These are places where you also want to have your changes mirrored when
    # you push
    pushurl = shironeko@members.tesaguri.club:git/repo.git
    # careful, you also need to specify the main one again here
    pushurl = git@git.sr.ht:~shironeko/repo