2024-07-29 23:09:42 -05:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
useremail,
|
|
|
|
...
|
|
|
|
}: {
|
|
|
|
# `programs.git` will generate the config file: ~/.config/git/config
|
|
|
|
# to make git use this config file, `~/.gitconfig` should not exist!
|
|
|
|
#
|
|
|
|
# https://git-scm.com/docs/git-config#Documentation/git-config.txt---global
|
|
|
|
home.activation.removeExistingGitconfig = lib.hm.dag.entryBefore ["checkLinkTargets"] ''
|
|
|
|
rm -f ~/.gitconfig
|
|
|
|
'';
|
|
|
|
|
|
|
|
programs.git = {
|
|
|
|
enable = true;
|
2024-08-15 21:38:53 -05:00
|
|
|
userName = "Wyatt J. Miller";
|
2024-07-29 23:09:42 -05:00
|
|
|
userEmail = useremail;
|
|
|
|
|
|
|
|
extraConfig = {
|
|
|
|
init.defaultBranch = "master";
|
|
|
|
push.autoSetupRemote = true;
|
|
|
|
pull.rebase = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
ignores = [
|
|
|
|
".DS_Store"
|
|
|
|
".direnv"
|
|
|
|
".idea"
|
|
|
|
];
|
|
|
|
|
|
|
|
aliases = {
|
|
|
|
# common aliases
|
|
|
|
br = "branch";
|
|
|
|
co = "checkout";
|
|
|
|
st = "status";
|
|
|
|
ls = "log --pretty=format:\"%C(yellow)%h%Cred%d\\\\ %Creset%s%Cblue\\\\ [%cn]\" --decorate";
|
|
|
|
ll = "log --pretty=format:\"%C(yellow)%h%Cred%d\\\\ %Creset%s%Cblue\\\\ [%cn]\" --decorate --numstat";
|
|
|
|
cm = "commit -m";
|
|
|
|
ca = "commit -am";
|
|
|
|
dc = "diff --cached";
|
|
|
|
amend = "commit --amend -m";
|
|
|
|
|
|
|
|
# aliases for submodule
|
|
|
|
update = "submodule update --init --recursive";
|
|
|
|
foreach = "submodule foreach";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|