2021-12-08 16:26:56 +01:00
|
|
|
{pkgs, ...}:
|
|
|
|
{
|
|
|
|
programs.git = {
|
|
|
|
enable = true;
|
|
|
|
package = pkgs.gitFull;
|
2021-12-11 15:29:12 +01:00
|
|
|
|
2021-12-08 16:26:56 +01:00
|
|
|
userName = "h7x4";
|
|
|
|
userEmail = "h7x4abk3g@protonmail.com";
|
2021-12-11 15:29:12 +01:00
|
|
|
|
2021-12-08 16:26:56 +01:00
|
|
|
aliases = {
|
|
|
|
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";
|
2021-12-11 15:29:12 +01:00
|
|
|
|
2021-12-08 16:26:56 +01:00
|
|
|
mkbr = "checkout -b";
|
|
|
|
mvbr = "branch -m";
|
|
|
|
rmbr = "branch -d";
|
|
|
|
rrmbr = "push origin --delete";
|
2021-12-11 15:29:12 +01:00
|
|
|
|
2021-12-08 16:26:56 +01:00
|
|
|
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";
|
|
|
|
g = "!git graph";
|
|
|
|
};
|
2021-12-11 15:29:12 +01:00
|
|
|
|
2021-12-08 16:26:56 +01:00
|
|
|
extraConfig = {
|
|
|
|
core = {
|
|
|
|
whitespace = "space-before-tab,-indent-with-non-tab,trailing-space";
|
2021-12-11 15:29:12 +01:00
|
|
|
|
2021-12-08 16:26:56 +01:00
|
|
|
precomposeunicode = false;
|
|
|
|
untrackedCache = true;
|
2021-12-11 15:29:12 +01:00
|
|
|
|
2021-12-08 16:26:56 +01:00
|
|
|
editor = "nvim";
|
|
|
|
pager = "less";
|
|
|
|
};
|
2021-12-11 15:29:12 +01:00
|
|
|
|
2021-12-08 16:26:56 +01:00
|
|
|
"color \"branch\"".upstream = "cyan";
|
|
|
|
color.ui = "auto";
|
2021-12-11 15:29:12 +01:00
|
|
|
|
2021-12-08 16:26:56 +01:00
|
|
|
init.defaultBranch = "main";
|
|
|
|
fetch.prune = true;
|
|
|
|
pull.rebase = true;
|
|
|
|
push.default = "current";
|
2021-12-11 15:29:12 +01:00
|
|
|
|
2021-12-08 16:26:56 +01:00
|
|
|
merge = {
|
|
|
|
tool = "nvimdiff";
|
|
|
|
conflictstyle = "diff3";
|
|
|
|
colorMoved = "zebra";
|
|
|
|
};
|
2021-12-11 15:29:12 +01:00
|
|
|
|
2021-12-08 16:26:56 +01:00
|
|
|
mergetool.keepBackup = false;
|
|
|
|
"mergetool \"nvimdiff\"".cmd = "nvim -d $BASE $LOCAL $REMOTE $MERGED -c '$wincmd w' -c 'wincmd J'";
|
2021-12-11 15:29:12 +01:00
|
|
|
|
2021-12-08 16:26:56 +01:00
|
|
|
diff = {
|
|
|
|
mnemonicPrefix = true;
|
|
|
|
renames = true;
|
|
|
|
tool = "nvimdiff";
|
|
|
|
};
|
2021-12-11 15:29:12 +01:00
|
|
|
|
2021-12-08 16:26:56 +01:00
|
|
|
grep = {
|
|
|
|
break = true;
|
|
|
|
heading= true;
|
|
|
|
lineNumber = true;
|
|
|
|
extendedRegexp = true;
|
|
|
|
};
|
2021-12-11 15:29:12 +01:00
|
|
|
|
2021-12-08 16:26:56 +01:00
|
|
|
github.user = "h7x4abk3g";
|
2021-12-11 15:29:12 +01:00
|
|
|
|
2021-12-08 16:26:56 +01:00
|
|
|
web.browser = "google-chrome-stable";
|
2021-12-11 15:29:12 +01:00
|
|
|
|
2021-12-08 16:26:56 +01:00
|
|
|
"filter \"lfs\"" = {
|
|
|
|
required = true;
|
|
|
|
smudge = "git-lfs smudge -- %f";
|
|
|
|
process = "git-lfs filter-process";
|
|
|
|
clean = "git-lfs clean -- %f";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|