nix-infra/modules/home/git/default.nix
2024-05-04 12:03:59 +02:00

24 lines
656 B
Nix

{ ... }: {
programs.git = {
enable = true;
extraConfig = {
init = { defaultBranch = "main"; };
core = { editor = "nvim"; };
pull.rebase = true;
push.autoSetupRemote = true;
};
aliases = {
a = "add";
ai = "add -p";
br = "branch --format='%(HEAD) %(color:yellow)%(refname:short)%(color:reset) - %(contents:subject) %(color:green)(%(committerdate:relative)) [%(authorname)]' --sort=-committerdate";
c = "commit";
del = "branch -D";
p = "push";
pf = "push --force-with-lease";
r = "rebase";
ri = "rebase -i";
s = "status";
sw = "switch";
};
};
}