git: misc changes

- add some better push default configs
- remove a bunch of unused aliases
- remove `precomposeunicode = false` noop
- add `forcepush` alias
This commit is contained in:
Oystein Kristoffer Tveit 2023-02-25 17:55:35 +01:00
parent 8515ea162b
commit b854b66c08
Signed by: oysteikt
GPG Key ID: 9F2F7D8250F35146
1 changed files with 7 additions and 16 deletions

View File

@ -23,30 +23,16 @@
aliases = { aliases = {
aliases = "!git config --get-regexp alias | sed -re 's/alias\\.(\\S*)\\s(.*)$/\\1 = \\2/g'"; aliases = "!git config --get-regexp alias | sed -re 's/alias\\.(\\S*)\\s(.*)$/\\1 = \\2/g'";
uncommit = "reset --soft HEAD^";
rev = "checkout HEAD -- ";
revall = "checkout .";
# unstage = "rm --cached ";
unstage = "restore --staged ";
delete-merged = "!git branch --merged | grep -v '\\*' | xargs -n 1 git branch -d"; delete-merged = "!git branch --merged | grep -v '\\*' | xargs -n 1 git branch -d";
mkbr = "checkout -b";
mvbr = "branch -m";
rmbr = "branch -d";
rrmbr = "push origin --delete";
graph = "log --graph --abbrev-commit --decorate --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)' --all"; graph = "log --graph --abbrev-commit --decorate --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)' --all";
graphv = "log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset)%n'' %C(white)%s%C(reset) %C(dim white)- %an%C(reset)' --all"; graphv = "log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset)%n'' %C(white)%s%C(reset) %C(dim white)- %an%C(reset)' --all";
g = "!git graph"; forcepush = "push --force-with-lease --force-if-includes";
}; };
extraConfig = { extraConfig = {
core = { core = {
whitespace = "space-before-tab,-indent-with-non-tab,trailing-space"; whitespace = "space-before-tab,-indent-with-non-tab,trailing-space";
precomposeunicode = false;
untrackedCache = true; untrackedCache = true;
editor = "nvim"; editor = "nvim";
}; };
@ -56,7 +42,12 @@
init.defaultBranch = "main"; init.defaultBranch = "main";
fetch.prune = true; fetch.prune = true;
pull.rebase = true; pull.rebase = true;
push.default = "current";
push = {
default = "current";
autoSetupRemote = true;
followTags = true;
};
merge = { merge = {
tool = "nvimdiff"; tool = "nvimdiff";